diff options
author | Derek Higgins <derekh@redhat.com> | 2021-08-03 12:10:44 +0100 |
---|---|---|
committer | Derek Higgins <derekh@redhat.com> | 2021-08-03 12:01:17 +0000 |
commit | caf695f70ab366498b46cb6f07f6751369c67e30 (patch) | |
tree | 608f46690c9ae867e7e6ead453beb1a06568c965 | |
parent | 9b42b08edd85933c3f96444a649b0d80f16ec8d0 (diff) | |
download | ironic-python-agent-caf695f70ab366498b46cb6f07f6751369c67e30.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
-rw-r--r-- | ironic_python_agent/extensions/image.py | 4 | ||||
-rw-r--r-- | ironic_python_agent/tests/unit/extensions/test_image.py | 38 |
2 files changed, 21 insertions, 21 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py index 84e86f17..b38742b3 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')] |