summaryrefslogtreecommitdiff
path: root/ironic_python_agent/efi_utils.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2021-11-19 14:48:38 +0100
committerDmitry Tantsur <dtantsur@protonmail.com>2021-11-19 14:51:27 +0100
commitabe38a6a5fb8cbfda4064351103b0ec6971dfd3e (patch)
treec6902e7f21cadbc88c04a49e9c64dae100dad4b0 /ironic_python_agent/efi_utils.py
parentde385cb291ed5c438dde68398f1a83cb28c5aa1f (diff)
downloadironic-python-agent-abe38a6a5fb8cbfda4064351103b0ec6971dfd3e.tar.gz
Fix compatibility with disk_utils.find_efi_partition
This function returns the complete block device record, not just number. Fixes regression in 89bc73aa0105850c6ae44428642e31802bba3b20. Also fix the incorrect job in the gate queue, which prevented us from catching this issue on merging. Change-Id: I4cbc359ceabfc193ce18fed14a1952359460e7d9
Diffstat (limited to 'ironic_python_agent/efi_utils.py')
-rw-r--r--ironic_python_agent/efi_utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ironic_python_agent/efi_utils.py b/ironic_python_agent/efi_utils.py
index 6f6b103c..1f28f635 100644
--- a/ironic_python_agent/efi_utils.py
+++ b/ironic_python_agent/efi_utils.py
@@ -50,6 +50,9 @@ def manage_uefi(device, efi_system_part_uuid=None):
local_path = tempfile.mkdtemp()
# Trust the contents on the disk in the event of a whole disk image.
efi_partition = disk_utils.find_efi_partition(device)
+ if efi_partition:
+ efi_partition = efi_partition['number']
+
if not efi_partition and efi_system_part_uuid:
# _get_partition returns <device>+<partition> and we only need the
# partition number
@@ -100,7 +103,7 @@ def manage_uefi(device, efi_system_part_uuid=None):
return False
except processutils.ProcessExecutionError as e:
- error_msg = ('Could not verify uefi on device %(dev)s'
+ error_msg = ('Could not verify uefi on device %(dev)s, '
'failed with %(err)s.' % {'dev': device, 'err': e})
LOG.error(error_msg)
raise errors.CommandExecutionError(error_msg)