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


Python Defaults.get_lvm_overhead_mbytes方法代码示例

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


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

示例1: test_get_disksize_mbytes_empty_volumes

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_lvm_overhead_mbytes [as 别名]
 def test_get_disksize_mbytes_empty_volumes(self):
     assert self.setup_empty_volumes.get_disksize_mbytes() == \
         Defaults.get_lvm_overhead_mbytes() + \
         Defaults.get_default_legacy_bios_mbytes() + \
         Defaults.get_default_efi_boot_mbytes() + \
         Defaults.get_default_boot_mbytes() + \
         self.size.accumulate_mbyte_file_sizes.return_value
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:9,代码来源:storage_setup_test.py

示例2: test_get_disksize_mbytes_root_volume

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_lvm_overhead_mbytes [as 别名]
 def test_get_disksize_mbytes_root_volume(self, mock_log_warn, mock_exists):
     mock_exists.return_value = True
     root_size = self.size.accumulate_mbyte_file_sizes.return_value
     assert self.setup_root_volume.get_disksize_mbytes() == \
         Defaults.get_lvm_overhead_mbytes() + \
         Defaults.get_default_legacy_bios_mbytes() + \
         Defaults.get_default_efi_boot_mbytes() + \
         Defaults.get_default_boot_mbytes() + \
         root_size
     assert mock_log_warn.called
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:12,代码来源:storage_setup_test.py

示例3: test_get_disksize_mbytes_oem_volumes

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_lvm_overhead_mbytes [as 别名]
 def test_get_disksize_mbytes_oem_volumes(self, mock_exists):
     mock_exists.return_value = True
     root_size = self.size.accumulate_mbyte_file_sizes.return_value
     assert self.setup_oem_volumes.get_disksize_mbytes() == \
         Defaults.get_lvm_overhead_mbytes() + \
         Defaults.get_default_legacy_bios_mbytes() + \
         Defaults.get_default_efi_boot_mbytes() + \
         Defaults.get_default_boot_mbytes() + \
         root_size + \
         5 * Defaults.get_min_volume_mbytes()
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:12,代码来源:storage_setup_test.py

示例4: get_disksize_mbytes

# 需要导入模块: from kiwi.defaults import Defaults [as 别名]
# 或者: from kiwi.defaults.Defaults import get_lvm_overhead_mbytes [as 别名]
    def get_disksize_mbytes(self):
        """
        Precalculate disk size requirements in mbytes

        :return: disk size mbytes

        :rtype: int
        """
        log.info('Precalculating required disk size')
        calculated_disk_mbytes = 0
        root_filesystem_mbytes = self.rootsize.customize(
            self.rootsize.accumulate_mbyte_file_sizes(), self.filesystem
        )
        calculated_disk_mbytes += root_filesystem_mbytes
        log.info(
            '--> system data with filesystem overhead needs %s MB',
            root_filesystem_mbytes
        )
        if self.volume_manager and self.volume_manager == 'lvm':
            lvm_overhead_mbytes = Defaults.get_lvm_overhead_mbytes()
            log.info(
                '--> LVM overhead adding %s MB', lvm_overhead_mbytes
            )
            calculated_disk_mbytes += lvm_overhead_mbytes
            volume_mbytes = self._accumulate_volume_size(
                root_filesystem_mbytes
            )
            if volume_mbytes:
                calculated_disk_mbytes += volume_mbytes
                log.info(
                    '--> volume(s) size setup adding %s MB', volume_mbytes
                )

        legacy_bios_mbytes = self.firmware.get_legacy_bios_partition_size()
        if legacy_bios_mbytes:
            calculated_disk_mbytes += legacy_bios_mbytes
            log.info(
                '--> legacy bios boot partition adding %s MB',
                legacy_bios_mbytes
            )

        boot_mbytes = self.boot_partition_size()
        if boot_mbytes:
            calculated_disk_mbytes += boot_mbytes
            log.info(
                '--> boot partition adding %s MB', boot_mbytes
            )

        if self.spare_part_mbytes:
            calculated_disk_mbytes += self.spare_part_mbytes
            log.info(
                '--> spare partition adding %s MB', self.spare_part_mbytes
            )

        efi_mbytes = self.firmware.get_efi_partition_size()
        if efi_mbytes:
            calculated_disk_mbytes += efi_mbytes
            log.info(
                '--> EFI partition adding %s MB', efi_mbytes
            )

        prep_mbytes = self.firmware.get_prep_partition_size()
        if prep_mbytes:
            calculated_disk_mbytes += prep_mbytes
            log.info(
                '--> PReP partition adding %s MB', prep_mbytes
            )

        recovery_mbytes = self._inplace_recovery_partition_size()
        if recovery_mbytes:
            calculated_disk_mbytes += recovery_mbytes
            log.info(
                '--> In-place recovery partition adding: %s MB',
                recovery_mbytes
            )

        if not self.configured_size:
            log.info(
                'Using calculated disk size: %d MB',
                calculated_disk_mbytes
            )
            return calculated_disk_mbytes
        elif self.configured_size.additive:
            result_disk_mbytes = \
                self.configured_size.mbytes + calculated_disk_mbytes
            log.info(
                'Using configured disk size: %d MB + %d MB calculated = %d MB',
                self.configured_size.mbytes,
                calculated_disk_mbytes,
                result_disk_mbytes
            )
            return result_disk_mbytes
        else:
            log.info(
                'Using configured disk size: %d MB',
                self.configured_size.mbytes
            )
            if self.configured_size.mbytes < calculated_disk_mbytes:
                log.warning(
                    '--> Configured size smaller than calculated size: %d MB',
#.........这里部分代码省略.........
开发者ID:Conan-Kudo,项目名称:kiwi,代码行数:103,代码来源:setup.py


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