本文整理汇总了Python中kiwi.defaults.Defaults.get_filesystem_image_types方法的典型用法代码示例。如果您正苦于以下问题:Python Defaults.get_filesystem_image_types方法的具体用法?Python Defaults.get_filesystem_image_types怎么用?Python Defaults.get_filesystem_image_types使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kiwi.defaults.Defaults
的用法示例。
在下文中一共展示了Defaults.get_filesystem_image_types方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __new__
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_filesystem_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: __init__
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_filesystem_image_types [as 别名]
def __init__(self, xml_state, root_dir):
self.configured_size = xml_state.get_build_type_size()
self.size = SystemSize(root_dir)
self.requested_image_type = xml_state.get_build_type_name()
if self.requested_image_type in Defaults.get_filesystem_image_types():
self.requested_filesystem = self.requested_image_type
else:
self.requested_filesystem = xml_state.build_type.get_filesystem()
示例3: create
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_filesystem_image_types [as 别名]
def create(self):
"""
Build a mountable filesystem image
Image types which triggers this builder are:
* image="ext2"
* image="ext3"
* image="ext4"
* image="btrfs"
* image="xfs"
:return: result
:rtype: instance of :class:`Result`
"""
log.info(
'Creating %s filesystem', self.requested_filesystem
)
supported_filesystems = Defaults.get_filesystem_image_types()
if self.requested_filesystem not in supported_filesystems:
raise KiwiFileSystemSetupError(
'Unknown filesystem: %s' % self.requested_filesystem
)
if self.requested_filesystem not in self.filesystems_no_device_node:
self._operate_on_loop()
else:
self._operate_on_file()
self.result.verify_image_size(
self.runtime_config.get_max_size_constraint(),
self.filename
)
self.result.add(
key='filesystem_image',
filename=self.filename,
use_for_bundle=True,
compress=True,
shasum=True
)
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
示例4: __init__
# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_filesystem_image_types [as 别名]
def __init__(self, xml_state, root_dir):
self.configured_size = xml_state.get_build_type_size(
include_unpartitioned=True
)
if xml_state.get_build_type_unpartitioned_bytes() > 0:
log.warning(
'Unpartitoned size attribute is ignored for filesystem images'
)
self.size = SystemSize(root_dir)
self.requested_image_type = xml_state.get_build_type_name()
if self.requested_image_type in Defaults.get_filesystem_image_types():
self.requested_filesystem = self.requested_image_type
else:
self.requested_filesystem = xml_state.build_type.get_filesystem()