summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Higgins <derekh@redhat.com>2021-08-03 12:10:44 +0100
committerJulia Kreger <juliaashleykreger@gmail.com>2021-11-08 07:17:47 -0700
commit9753b61a51008da4f0b948b0c89665b762eb95c4 (patch)
tree0c4037749aca199969235415a839b2e3be4d1a9c
parent434a7391293cea8bfdc9faa373187ad102f030f6 (diff)
downloadironic-python-agent-9753b61a51008da4f0b948b0c89665b762eb95c4.tar.gz
Output verbose info from efibootmgr
When debugging boot manager problems it can be advantageous to see all the full entries rather then just their labels. Change-Id: I6a1bb78acaf5a4284727bdf533d4be6db2099f50 (cherry picked from commit caf695f70ab366498b46cb6f07f6751369c67e30)
-rw-r--r--ironic_python_agent/extensions/image.py6
-rw-r--r--ironic_python_agent/tests/unit/extensions/test_image.py38
2 files changed, 22 insertions, 22 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py
index a39ed353..3f793403 100644
--- a/ironic_python_agent/extensions/image.py
+++ b/ironic_python_agent/extensions/image.py
@@ -274,8 +274,8 @@ def _run_efibootmgr(valid_efi_bootloaders, device, efi_partition,
"""
# Before updating let's get information about the bootorder
- LOG.debug("Getting information about boot order")
- utils.execute('efibootmgr')
+ LOG.debug("Getting information about boot order.")
+ utils.execute('efibootmgr', '-v')
# NOTE(iurygregory): regex used to identify the Warning in the stderr after
# we add the new entry. Example:
# "efibootmgr: ** Warning ** : Boot0004 has same label ironic"
@@ -302,7 +302,7 @@ def _run_efibootmgr(valid_efi_bootloaders, device, efi_partition,
'dev': device})
# Update the nvram using efibootmgr
# https://linux.die.net/man/8/efibootmgr
- cmd = utils.execute('efibootmgr', '-c', '-d', device,
+ cmd = utils.execute('efibootmgr', '-v', '-c', '-d', device,
'-p', efi_partition, '-w', '-L', label,
'-l', v_efi_bl_path)
for line in cmd[1].split('\n'):
diff --git a/ironic_python_agent/tests/unit/extensions/test_image.py b/ironic_python_agent/tests/unit/extensions/test_image.py
index f524bc5b..196a537b 100644
--- a/ironic_python_agent/tests/unit/extensions/test_image.py
+++ b/ironic_python_agent/tests/unit/extensions/test_image.py
@@ -259,8 +259,8 @@ class TestImageExtension(base.IronicAgentTest):
mock.call('udevadm', 'settle'),
mock.call('mount', self.fake_efi_system_part,
self.fake_dir + '/boot/efi'),
- mock.call('efibootmgr'),
- mock.call('efibootmgr', '-c', '-d', self.fake_dev,
+ mock.call('efibootmgr', '-v'),
+ mock.call('efibootmgr', '-v', '-c', '-d', self.fake_dev,
'-p', '1', '-w',
'-L', 'ironic1', '-l',
'\\EFI\\BOOT\\BOOTX64.EFI'),
@@ -307,8 +307,8 @@ class TestImageExtension(base.IronicAgentTest):
mock.call('udevadm', 'settle'),
mock.call('mount', self.fake_efi_system_part,
self.fake_dir + '/boot/efi'),
- mock.call('efibootmgr'),
- mock.call('efibootmgr', '-c', '-d', self.fake_dev,
+ mock.call('efibootmgr', '-v'),
+ mock.call('efibootmgr', '-v', '-c', '-d', self.fake_dev,
'-p', '1', '-w',
'-L', 'ironic1', '-l',
'\\EFI\\BOOT\\BOOTX64.EFI'),
@@ -360,8 +360,8 @@ efibootmgr: ** Warning ** : Boot0005 has same label ironic1\n
mock.call('udevadm', 'settle'),
mock.call('mount', self.fake_efi_system_part,
self.fake_dir + '/boot/efi'),
- mock.call('efibootmgr'),
- mock.call('efibootmgr', '-c', '-d', self.fake_dev,
+ mock.call('efibootmgr', '-v'),
+ mock.call('efibootmgr', '-v', '-c', '-d', self.fake_dev,
'-p', '1', '-w',
'-L', 'ironic1', '-l',
'\\EFI\\BOOT\\BOOTX64.EFI'),
@@ -413,12 +413,12 @@ efibootmgr: ** Warning ** : Boot0005 has same label ironic1\n
mock.call('udevadm', 'settle'),
mock.call('mount', self.fake_efi_system_part,
self.fake_dir + '/boot/efi'),
- mock.call('efibootmgr'),
- mock.call('efibootmgr', '-c', '-d', self.fake_dev,
+ mock.call('efibootmgr', '-v'),
+ mock.call('efibootmgr', '-v', '-c', '-d', self.fake_dev,
'-p', '1', '-w',
'-L', 'ironic1', '-l',
'\\EFI\\BOOT\\BOOTX64.EFI'),
- mock.call('efibootmgr', '-c', '-d', self.fake_dev,
+ mock.call('efibootmgr', '-v', '-c', '-d', self.fake_dev,
'-p', '1', '-w',
'-L', 'ironic2', '-l',
'\\WINDOWS\\system32\\winload.efi'),
@@ -2142,8 +2142,8 @@ efibootmgr: ** Warning ** : Boot0005 has same label ironic1\n
mock.call('udevadm', 'settle'),
mock.call('mount', self.fake_efi_system_part,
self.fake_dir + '/boot/efi'),
- mock.call('efibootmgr'),
- mock.call('efibootmgr', '-c', '-d', self.fake_dev,
+ mock.call('efibootmgr', '-v'),
+ mock.call('efibootmgr', '-v', '-c', '-d', self.fake_dev,
'-p', '1', '-w',
'-L', 'ironic1', '-l',
'\\EFI\\BOOT\\BOOTX64.EFI'),
@@ -2186,8 +2186,8 @@ efibootmgr: ** Warning ** : Boot0005 has same label ironic1\n
mock.call('udevadm', 'settle'),
mock.call('mount', self.fake_efi_system_part,
self.fake_dir + '/boot/efi'),
- mock.call('efibootmgr'),
- mock.call('efibootmgr', '-c', '-d', self.fake_dev,
+ mock.call('efibootmgr', '-v'),
+ mock.call('efibootmgr', '-v', '-c', '-d', self.fake_dev,
'-p', '1', '-w',
'-L', 'Vendor String', '-l',
'\\EFI\\vendor\\shimx64.efi'),
@@ -2226,8 +2226,8 @@ efibootmgr: ** Warning ** : Boot0005 has same label ironic1\n
mock.call('udevadm', 'settle'),
mock.call('mount', '/dev/fakenvme0p1',
self.fake_dir + '/boot/efi'),
- mock.call('efibootmgr'),
- mock.call('efibootmgr', '-c', '-d', '/dev/fakenvme0',
+ mock.call('efibootmgr', '-v'),
+ mock.call('efibootmgr', '-v', '-c', '-d', '/dev/fakenvme0',
'-p', '1', '-w',
'-L', 'ironic1', '-l',
'\\EFI\\BOOT\\BOOTX64.EFI'),
@@ -2266,8 +2266,8 @@ efibootmgr: ** Warning ** : Boot0005 has same label ironic1\n
mock.call('udevadm', 'settle'),
mock.call('mount', self.fake_efi_system_part,
self.fake_dir + '/boot/efi'),
- mock.call('efibootmgr'),
- mock.call('efibootmgr', '-c', '-d', self.fake_dev,
+ mock.call('efibootmgr', '-v'),
+ mock.call('efibootmgr', '-v', '-c', '-d', self.fake_dev,
'-p', '1', '-w',
'-L', 'ironic1', '-l',
'\\EFI\\BOOT\\BOOTX64.EFI'),
@@ -2373,8 +2373,8 @@ efibootmgr: ** Warning ** : Boot0005 has same label ironic1\n
self.fake_dev,
self.fake_efi_system_part,
self.fake_dir)
- expected = [mock.call('efibootmgr'),
- mock.call('efibootmgr', '-c', '-d', self.fake_dev,
+ expected = [mock.call('efibootmgr', '-v'),
+ mock.call('efibootmgr', '-v', '-c', '-d', self.fake_dev,
'-p', self.fake_efi_system_part, '-w',
'-L', 'ironic1', '-l',
'\\EFI\\BOOT\\BOOTX64.EFI')]