本文整理汇总了Python中stratuslab.Util.get_template_file方法的典型用法代码示例。如果您正苦于以下问题:Python Util.get_template_file方法的具体用法?Python Util.get_template_file怎么用?Python Util.get_template_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stratuslab.Util
的用法示例。
在下文中一共展示了Util.get_template_file方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import get_template_file [as 别名]
def __init__(self, configHolder=ConfigHolder()):
self.persistentDiskDbHost = 'localhost'
self.configHolder = configHolder
self.configHolder.assign(self)
self.profile = None # Can be frontend or node
self.system = SystemFactory.getSystem(self.persistentDiskSystem,
self.configHolder)
# Package to be installed
self.packages = {'frontend': {
'pdisk': ['stratuslab-pdisk-server', ],
'iscsi': ['scsi-target-utils', 'iscsi-initiator-utils'],
'nfs': ['nfs-utils', 'nfs-utils-lib'],
'lvm': ['lvm2', ],
'file': ['qemu-img'],
},
'node': {
'pdisk': ['stratuslab-pdisk-host', ],
'iscsi': ['iscsi-initiator-utils', ],
'nfs': ['nfs-utils', 'nfs-utils-lib'],
'lvm': [],
'file': [],
},
}
self.pdiskConfigBackendTpl = Util.get_template_file([self.PDISK_BACKEND_CONF_NAME + '.tpl'])
self.authnConfigFile = Defaults.AUTHN_CONFIG_FILE
self.pdiskConfigFile = os.path.join(Defaults.ETC_DIR, 'pdisk.cfg')
self.pdiskHostConfigFile2 = os.path.join(Defaults.ETC_DIR, 'pdisk-host.conf')
self.pdiskHomeDir = '/opt/stratuslab/storage/pdisk'
self.cloudNodeKey = os.path.join(self.pdiskHomeDir, 'cloud_node.key')
self.pdiskUsername = 'pdisk'
self.pdiskPassword = self._extractPdiskPassword()
示例2: _getTemplateFile
# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import get_template_file [as 别名]
def _getTemplateFile(self, tpl, name):
try:
return Util.get_template_file([tpl])
except:
printError("%s template does not exist" % name)
return tpl
示例3: _setupFrontend
# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import get_template_file [as 别名]
def _setupFrontend(self):
printStep('Creating monitoring configuration file')
monitoringTpl = Util.get_template_file(['monitoring.cfg.tpl'])
monitoringConfFile = os.path.join(Defaults.ETC_DIR, 'monitoring.cfg')
self._writeConfigFromTemplate(monitoringConfFile, monitoringTpl)
示例4: _setupFrontend
# 需要导入模块: from stratuslab import Util [as 别名]
# 或者: from stratuslab.Util import get_template_file [as 别名]
def _setupFrontend(self):
self._validateParameters()
printStep('Creating registration configuration file')
registrationTpl = Util.get_template_file(['registration.cfg.tpl'])
registrationConfFile = os.path.join(Defaults.ETC_DIR, 'registration.cfg')
self._writeConfigFromTemplate(registrationConfFile, registrationTpl)