当前位置: 首页>>代码示例>>Python>>正文


Python Defaults.get_buildservice_env_name方法代码示例

本文整理汇总了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')
开发者ID:Conan-Kudo,项目名称:kiwi,代码行数:16,代码来源:oci.py

示例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)
开发者ID:Conan-Kudo,项目名称:kiwi,代码行数:42,代码来源:root_init.py


注:本文中的kiwi.defaults.Defaults.get_buildservice_env_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。