diff options
| author | Zuul <zuul@review.opendev.org> | 2021-05-10 15:00:21 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2021-05-10 15:00:21 +0000 |
| commit | 9837f1c2f008d7e02dbf14f20f520c70e1281477 (patch) | |
| tree | 43d38df3bf9a08c482cbad3feec85d99cc538b3d /ironic_python_agent/extensions | |
| parent | 5c01ec4f6f9268ea2a53907913f4cc510fa8d629 (diff) | |
| parent | fe825fa97ed1f3c9fa8b1461b63ab133fec20b72 (diff) | |
| download | ironic-python-agent-9837f1c2f008d7e02dbf14f20f520c70e1281477.tar.gz | |
Merge "Fix NVMe Partition image on UEFI"
Diffstat (limited to 'ironic_python_agent/extensions')
| -rw-r--r-- | ironic_python_agent/extensions/image.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py index c482b69c..8aa71e79 100644 --- a/ironic_python_agent/extensions/image.py +++ b/ironic_python_agent/extensions/image.py @@ -300,7 +300,12 @@ def _manage_uefi(device, efi_system_part_uuid=None): # _get_partition returns <device>+<partition> and we only need the # partition number partition = _get_partition(device, uuid=efi_system_part_uuid) - efi_partition = int(partition.replace(device, "")) + try: + efi_partition = int(partition.replace(device, "")) + except ValueError: + # NVMe Devices get a partitioning scheme that is different from + # traditional block devices like SCSI/SATA + efi_partition = int(partition.replace(device + 'p', "")) if not efi_partition: # NOTE(dtantsur): we cannot have a valid EFI deployment without an |
