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-10 11:04:49 -0800
commitd8151dc32f3de6bb9f784029cce666490f208b90 (patch)
treeb0e07305b438f1a28c00d5f29f6e46744549794d
parent198f06e001b237debaa718d87b8d112e542db1fa (diff)
downloadironic-python-agent-d8151dc32f3de6bb9f784029cce666490f208b90.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.py4
-rw-r--r--ironic_python_agent/tests/unit/extensions/test_image.py38
2 files changed, 21 insertions, 21 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py
index cd4245db..8c52b87e 100644
--- a/ironic_python_agent/extensions/image.py
+++ b/ironic_python_agent/extensions/image.py
@@ -274,7 +274,7 @@ 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')
+ 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"
@@ -303,7 +303,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 05e937b8..33056575 100644
--- a/ironic_python_agent/tests/unit/extensions/test_image.py
+++ b/ironic_python_agent/tests/unit/extensions/test_image.py
@@ -236,8 +236,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'),
@@ -283,8 +283,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'),
@@ -335,8 +335,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'),
@@ -387,12 +387,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'),
@@ -2226,8 +2226,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'),
@@ -2270,8 +2270,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'),
@@ -2310,8 +2310,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'),
@@ -2350,8 +2350,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'),
@@ -2457,8 +2457,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')]