本文整理汇总了Python中stratuslab.Util.get_share_file方法的典型用法代码示例。如果您正苦于以下问题:Python Util.get_share_file方法的具体用法?Python Util.get_share_file怎么用?Python Util.get_share_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stratuslab.Util
的用法示例。
在下文中一共展示了Util.get_share_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getTemplatePath
# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import get_share_file [as 别名]
def getTemplatePath(instance=None):
if instance and hasattr(instance, "vmTemplateFile"):
return Util.get_share_file(["vm", "schema.one"], instance.vmTemplateFile)
else:
return Util.get_share_file(["vm", "schema.one"])
示例2: __init__
# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import get_share_file [as 别名]
def __init__(self, configHolder=ConfigHolder()):
self.os = ''
self.osversion = ''
self.arch = ''
self.type = '' # image type: base, grid, ..
self.version = '' # image version
self.created = '' # image creation time (in iso8601)
self.user = self.creator = '' # full name of image creator
self.email = '' # email address of endorser
self.compression = '' # image compression: gz, bz2, ..
self.title = ''
self.tag = ''
self.comment = ''
self.filename = '' # filename of compressed image (old manifest)
self.deprecated = ''
self.locations = [] # list of image URIs
self._locations_xml = '<slterms:location>%(location)s</slterms:location>'
self.kind = '' # image kind: machine, disk
self.format = '' # image format: raw, qcow2, ..
self.bytes = '0' # size of the uncompressed image on disk (in bytes)
self.md5 = ''
self.sha1 = ''
self.sha256 = ''
self.sha512 = ''
self.valid = '' # ManifestInfo.created + ManifestInfo.IMAGE_VALIDITY (in iso8601)
self.identifier = '' # base64 of int(sha1_hex, 16)
self.serialnumber = ''
self.hypervisor = '' # kvm, xen, ..
self.publisher = 'StratusLab'
self.disksbus = ManifestInfo.DISKS_BUS_DEFAULT
self.inboundports = ManifestInfo.INBOUND_PORTS_DEFAULT
self.verboseLevel = 0
configHolder.assign(self)
self._template = Util.get_share_file(['template', 'manifest.xml.tpl'])
self._manifestTemplateElements = \
(('type', 'type', NS_DCTERMS, None),
('created', 'created', NS_DCTERMS, None),
('valid', 'valid', NS_DCTERMS, None),
('title', 'title', NS_DCTERMS, ''),
('tag', 'alternative', NS_DCTERMS, ''),
('comment', 'description', NS_DCTERMS, None),
('compression', 'compression', NS_DCTERMS, None),
('creator', 'creator', NS_DCTERMS, self.creator),
('user', 'creator', NS_DCTERMS, self.creator),
('format', 'format', NS_DCTERMS, self.format),
('publisher', 'publisher', NS_DCTERMS, self.publisher),
('os', 'os', NS_SLTERMS, None),
('arch', 'os-arch', NS_SLTERMS, None),
('osversion', 'os-version', NS_SLTERMS, None),
('version', 'version', NS_SLTERMS, None),
('kind', 'kind', NS_SLTERMS, self.kind),
('disksbus', 'disks-bus', NS_SLTERMS, self.disksbus),
('hypervisor', 'hypervisor', NS_SLTERMS, self.hypervisor),
('email', 'email', NS_SLREQ, self.email))