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 1a67dddde7)
This commit is contained in:
Dmitry Tantsur 2020-10-07 12:10:55 +02:00
parent a27bb12be6
commit 38e6c36407
1 changed files with 8 additions and 0 deletions

View File

@ -712,7 +712,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)):