Skip to content

Commit

Permalink
Fix legacy bootmode enum to match pushsource
Browse files Browse the repository at this point in the history
  • Loading branch information
jajreidy committed Sep 7, 2023
1 parent e67499b commit 5f12809
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cloudimg/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AWSBootMode(enum.Enum):
uefi = "uefi"
"""Support UEFI only."""

bios = "legacy-bios"
legacy = "legacy-bios"
"""Support BIOS only."""

hybrid = "uefi-preferred"
Expand Down Expand Up @@ -76,7 +76,7 @@ def __init__(self, *args, **kwargs):
self.uefi_support is not None
):
self.boot_mode = AWSBootMode.hybrid if self.uefi_support \
else AWSBootMode.bios
else AWSBootMode.legacy

assert self.container, 'A container must be defined'

Expand Down
4 changes: 2 additions & 2 deletions tests/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ def test_register_image_tags(self, tag_image):
@patch('cloudimg.aws.AWSService.tag_image')
def test_register_image_boot_mode(self, tag_image):
self.mock_register_image.return_value = "fakeimg"
boot_modes = ["uefi", "bios", "hybrid"]
boot_modes = ["uefi", "legacy", "hybrid"]

for bmode in boot_modes:
self.md.boot_mode = AWSBootMode[bmode]
Expand Down Expand Up @@ -669,7 +669,7 @@ def test_register_image_uefi_support_bool(self, tag_image):
self.mock_register_image.return_value = "fakeimg"
uefi_support_map = {
True: AWSBootMode.hybrid,
False: AWSBootMode.bios,
False: AWSBootMode.legacy,
}

for bool_value, b_mode in uefi_support_map.items():
Expand Down

0 comments on commit 5f12809

Please sign in to comment.