summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2020-10-07 12:10:55 +0200
committerDmitry Tantsur <dtantsur@protonmail.com>2020-10-08 10:51:05 +0000
commit7705b3f72cd0947fb84817a5b723eb76769cd3b9 (patch)
tree2cb9a0cfb58f968f8d6687ba8497db85db48aa73
parent7bb40c0254075f21434b87483195d76e55f52be4 (diff)
downloadironic-python-agent-7705b3f72cd0947fb84817a5b723eb76769cd3b9.tar.gz
Log a warning of target_boot_mode does not match current boot mode
This is not a normal situation and is likely to cause problems. Change-Id: Id0668fd160ac0539d85997e985f8c43d9da75c90 (cherry picked from commit 1a67dddde7cad5a27e303a56bdeb484798bc796d)
-rw-r--r--ironic_python_agent/extensions/image.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py
index aa400091..64b26d0c 100644
--- a/ironic_python_agent/extensions/image.py
+++ b/ironic_python_agent/extensions/image.py
@@ -728,7 +728,15 @@ class ImageExtension(base.BaseAgentExtension):
device = hardware.dispatch_to_managers('get_os_install_device')
if self.agent.iscsi_started:
iscsi.clean_up(device)
+
boot = hardware.dispatch_to_managers('get_boot_info')
+ if boot.current_boot_mode != target_boot_mode:
+ LOG.warning('Boot mode mismatch: target boot mode is %(target)s, '
+ 'current boot mode is %(current)s. Installing boot '
+ 'loader may fail or work incorrectly.',
+ {'target': target_boot_mode,
+ 'current': boot.current_boot_mode})
+
# FIXME(arne_wiebalck): make software RAID work with efibootmgr
if (boot.current_boot_mode == 'uefi'
and not hardware.is_md_device(device)):