Merge "Don't break UEFI install with older IPAs"

This commit is contained in:
Zuul 2020-04-30 02:38:54 +00:00 committed by Gerrit Code Review
commit 39bcb00f3c
3 changed files with 15 additions and 12 deletions

View File

@ -1174,7 +1174,8 @@ class AgentDeployMixin(HeartbeatMixin):
node, root_uuid=root_uuid,
efi_system_part_uuid=efi_system_part_uuid,
prep_boot_part_uuid=prep_boot_part_uuid,
target_boot_mode=target_boot_mode
target_boot_mode=target_boot_mode,
software_raid=software_raid
)
if result['command_status'] == 'FAILED':
if not whole_disk_image:

View File

@ -276,7 +276,8 @@ class AgentClient(object):
@METRICS.timer('AgentClient.install_bootloader')
def install_bootloader(self, node, root_uuid, target_boot_mode,
efi_system_part_uuid=None,
prep_boot_part_uuid=None):
prep_boot_part_uuid=None,
software_raid=False):
"""Install a boot loader on the image.
:param node: A node object.
@ -315,12 +316,12 @@ class AgentClient(object):
wait=True,
command_timeout_factor=2)
except exception.AgentAPIError:
# NOTE(arne_wiebalck): If we require to pass 'uefi' as the boot
# mode, but find that the IPA does not yet support the additional
# NOTE(arne_wiebalck): If for software RAID and 'uefi' as the boot
# mode, we find that the IPA does not yet support the additional
# 'target_boot_mode' parameter, we need to fail. For 'bios' boot
# mode on the other hand we can retry without the parameter,
# since 'bios' is the default value the IPA will use.
if target_boot_mode == 'uefi':
if target_boot_mode == 'uefi' and software_raid:
LOG.error('Unable to pass UEFI boot mode to an out of date '
'agent ramdisk. Please contact the administrator '
'to update the ramdisk to contain an '

View File

@ -1187,7 +1187,7 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
install_bootloader_mock.assert_called_once_with(
mock.ANY, task.node, root_uuid='some-root-uuid',
efi_system_part_uuid=None, prep_boot_part_uuid=None,
target_boot_mode='whatever'
target_boot_mode='whatever', software_raid=False
)
@mock.patch.object(agent_client.AgentClient, 'install_bootloader',
@ -1212,7 +1212,7 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
install_bootloader_mock.assert_called_once_with(
mock.ANY, task.node, root_uuid='some-root-uuid',
efi_system_part_uuid=None, prep_boot_part_uuid='fake-prep',
target_boot_mode='whatever'
target_boot_mode='whatever', software_raid=False
)
@mock.patch.object(agent_client.AgentClient, 'install_bootloader',
@ -1238,7 +1238,7 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
mock.ANY, task.node, root_uuid='some-root-uuid',
efi_system_part_uuid='efi-system-part-uuid',
prep_boot_part_uuid=None,
target_boot_mode='uefi'
target_boot_mode='uefi', software_raid=False
)
@mock.patch.object(deploy_utils, 'try_set_boot_device', autospec=True)
@ -1285,7 +1285,8 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
install_bootloader_mock.assert_called_once_with(
mock.ANY, task.node, root_uuid=None,
efi_system_part_uuid='efi-system-part-uuid',
prep_boot_part_uuid=None, target_boot_mode='uefi')
prep_boot_part_uuid=None, target_boot_mode='uefi',
software_raid=False)
@mock.patch.object(image_service, 'GlanceImageService', autospec=True)
@mock.patch.object(deploy_utils, 'try_set_boot_device', autospec=True)
@ -1350,7 +1351,7 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
install_bootloader_mock.assert_called_once_with(
mock.ANY, task.node, root_uuid=root_uuid,
efi_system_part_uuid=None, prep_boot_part_uuid=None,
target_boot_mode='bios')
target_boot_mode='bios', software_raid=True)
try_set_boot_device_mock.assert_called_once_with(
task, boot_devices.DISK, persistent=True)
@ -1452,7 +1453,7 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
install_bootloader_mock.assert_called_once_with(
mock.ANY, task.node, root_uuid='some-root-uuid',
efi_system_part_uuid=None, prep_boot_part_uuid=None,
target_boot_mode='whatever'
target_boot_mode='whatever', software_raid=False
)
collect_logs_mock.assert_called_once_with(mock.ANY, task.node)
self.assertEqual(states.DEPLOYFAIL, task.node.provision_state)
@ -1485,7 +1486,7 @@ class AgentDeployMixinTest(AgentDeployMixinBaseTest):
install_bootloader_mock.assert_called_once_with(
mock.ANY, task.node, root_uuid='some-root-uuid',
efi_system_part_uuid=None, prep_boot_part_uuid=None,
target_boot_mode='whatever')
target_boot_mode='whatever', software_raid=False)
try_set_boot_device_mock.assert_called_once_with(
task, boot_devices.DISK, persistent=True)
collect_logs_mock.assert_called_once_with(mock.ANY, task.node)