本文整理汇总了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
)
示例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