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


Python Defaults.get_archive_image_types方法代码示例

本文整理汇总了Python中kiwi.defaults.Defaults.get_archive_image_types方法的典型用法代码示例。如果您正苦于以下问题:Python Defaults.get_archive_image_types方法的具体用法?Python Defaults.get_archive_image_types怎么用?Python Defaults.get_archive_image_types使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kiwi.defaults.Defaults的用法示例。


在下文中一共展示了Defaults.get_archive_image_types方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __new__

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_archive_image_types [as 别名]
 def __new__(self, xml_state, target_dir, root_dir, custom_args=None):
     requested_image_type = xml_state.get_build_type_name()
     if requested_image_type in Defaults.get_filesystem_image_types():
         return FileSystemBuilder(
             xml_state, target_dir, root_dir
         )
     elif requested_image_type in Defaults.get_disk_image_types():
         return DiskBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     elif requested_image_type in Defaults.get_live_image_types():
         return LiveImageBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     elif requested_image_type in Defaults.get_network_image_types():
         return PxeBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     elif requested_image_type in Defaults.get_archive_image_types():
         return ArchiveBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     elif requested_image_type in Defaults.get_container_image_types():
         return ContainerBuilder(
             xml_state, target_dir, root_dir, custom_args
         )
     else:
         raise KiwiRequestedTypeError(
             'requested image type %s not supported' % requested_image_type
         )
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:32,代码来源:__init__.py

示例2: create

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_archive_image_types [as 别名]
    def create(self):
        """
        Create a root archive tarball

        Build a simple XZ compressed root tarball from the image root tree

        Image types which triggers this builder are:

        * image="tbz"
        """
        supported_archives = Defaults.get_archive_image_types()
        if self.requested_archive_type not in supported_archives:
            raise KiwiArchiveSetupError(
                'Unknown archive type: %s' % self.requested_archive_type
            )

        if self.requested_archive_type == 'tbz':
            log.info('Creating XZ compressed tar archive')
            archive = ArchiveTar(
                self._target_file_for('tar')
            )
            archive.create_xz_compressed(
                self.root_dir, xz_options=self.xz_options,
                exclude=Defaults.get_exclude_list_for_root_data_sync()
            )
            checksum = Checksum(self.filename)
            log.info('--> Creating archive checksum')
            checksum.md5(self.checksum)
            self.result.verify_image_size(
                self.runtime_config.get_max_size_constraint(),
                self.filename
            )
            self.result.add(
                key='root_archive',
                filename=self.filename,
                use_for_bundle=True,
                compress=False,
                shasum=True
            )
            self.result.add(
                key='root_archive_md5',
                filename=self.checksum,
                use_for_bundle=False
            )
            self.result.add(
                key='image_packages',
                filename=self.system_setup.export_package_list(
                    self.target_dir
                ),
                use_for_bundle=True,
                compress=False,
                shasum=False
            )
            self.result.add(
                key='image_verified',
                filename=self.system_setup.export_package_verification(
                    self.target_dir
                ),
                use_for_bundle=True,
                compress=False,
                shasum=False
            )
        return self.result
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:65,代码来源:archive.py


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