boot: allow plans with None bootloader
This commit is contained in:
parent
b895fba66a
commit
b74e53679c
|
@ -142,6 +142,14 @@ class MountBootEfiPlan(MakeBootDevicePlan):
|
|||
manipulator._mount_esp(self.part)
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class NoOpBootPlan(MakeBootDevicePlan):
|
||||
"""Do nothing, successfully"""
|
||||
|
||||
def apply(self, manipulator):
|
||||
pass
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class MultiStepPlan(MakeBootDevicePlan):
|
||||
"""Execute several MakeBootDevicePlans in sequence."""
|
||||
|
@ -296,6 +304,8 @@ def get_boot_device_plan(device, resize_partition=None):
|
|||
return get_boot_device_plan_uefi(device, resize_partition)
|
||||
if bl == Bootloader.PREP:
|
||||
return get_boot_device_plan_prep(device, resize_partition)
|
||||
if bl == Bootloader.NONE:
|
||||
return NoOpBootPlan()
|
||||
raise Exception(f'unexpected bootloader {bl} here')
|
||||
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ class TestLayout(TestCase):
|
|||
|
||||
|
||||
bootloaders_and_ptables = [(bl, pt)
|
||||
for bl in list(Bootloader) if bl != Bootloader.NONE
|
||||
for bl in list(Bootloader)
|
||||
for pt in ('gpt', 'msdos', 'vtoc')]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue