From 7705b3f72cd0947fb84817a5b723eb76769cd3b9 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 7 Oct 2020 12:10:55 +0200 Subject: [PATCH] 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) --- ironic_python_agent/extensions/image.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ironic_python_agent/extensions/image.py b/ironic_python_agent/extensions/image.py index aa4000912..64b26d0c3 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)):