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

View File

@ -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)):