本文整理汇总了Python中kiwi.defaults.Defaults.get_buildservice_env_name方法的典型用法代码示例。如果您正苦于以下问题:Python Defaults.get_buildservice_env_name方法的具体用法?Python Defaults.get_buildservice_env_name怎么用?Python Defaults.get_buildservice_env_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.defaults.Defaults
的用法示例。
在下文中一共展示了Defaults.get_buildservice_env_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _append_buildservice_disturl_label
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_buildservice_env_name [as 别名]
def _append_buildservice_disturl_label(self):
with open(os.sep + Defaults.get_buildservice_env_name()) as env:
for line in env:
if line.startswith('BUILD_DISTURL') and '=' in line:
disturl = line.split('=')[1].strip()
if disturl:
self.labels.append(
''.join([
'--config.label='
'org.openbuildservice.disturl=',
line.split('=')[1].strip()
])
)
log.warning('Could not find BUILD_DISTURL inside .buildenv')
示例2: create
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_buildservice_env_name [as 别名]
def create(self):
"""
Create new system root directory
The method creates a temporary directory and initializes it
for the purpose of building a system image from it. This
includes the following setup:
* create static core device nodes
* create core system paths
On success the contents of the temporary location are
synced to the specified root_dir and the temporary location
will be deleted. That way we never work on an incomplete
initial setup
:raises KiwiRootInitCreationError: if the init creation fails
at some point
"""
root = mkdtemp(prefix='kiwi_root.')
Path.create(self.root_dir)
try:
self._create_base_directories(root)
self._create_base_links(root)
self._setup_config_templates(root)
data = DataSync(root + '/', self.root_dir)
data.sync_data(
options=['-a', '--ignore-existing']
)
if Defaults.is_buildservice_worker():
copy(
os.sep + Defaults.get_buildservice_env_name(),
self.root_dir)
except Exception as e:
self.delete()
raise KiwiRootInitCreationError(
'%s: %s' % (type(e).__name__, format(e))
)
finally:
rmtree(root, ignore_errors=True)