diff options
author | Zuul <zuul@review.opendev.org> | 2020-04-30 02:38:54 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-04-30 02:38:54 +0000 |
commit | 39bcb00f3cc624e8e215baa1b7e26eb7b2af5710 (patch) | |
tree | 2f431b571130074a055c8c349816adadd83e50f8 | |
parent | 1bb5e80ae4be54837cdca84f6bfbe180a79f37b2 (diff) | |
parent | b417d0ffa0fd46611ce9d4bdfe797259f9c26c3c (diff) | |
download | ironic-39bcb00f3cc624e8e215baa1b7e26eb7b2af5710.tar.gz |
Merge "Don't break UEFI install with older IPAs"15.0.0
-rw-r--r-- | ironic/drivers/modules/agent_base.py | 3 | ||||
-rw-r--r-- | ironic/drivers/modules/agent_client.py | 9 | ||||
-rw-r--r-- | ironic/tests/unit/drivers/modules/test_agent_base.py | 15 |
3 files changed, 15 insertions, 12 deletions
diff --git a/ironic/drivers/modules/agent_base.py b/ironic/drivers/modules/agent_base.py index 7195aaf3c..367802093 100644 --- a/ironic/drivers/modules/agent_base.py +++ b/ironic/drivers/modules/agent_base.py @@ -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: diff --git a/ironic/drivers/modules/agent_client.py b/ironic/drivers/modules/agent_client.py index feb4ebc88..eba9e6de8 100644 --- a/ironic/drivers/modules/agent_client.py +++ b/ironic/drivers/modules/agent_client.py @@ -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 ' diff --git a/ironic/tests/unit/drivers/modules/test_agent_base.py b/ironic/tests/unit/drivers/modules/test_agent_base.py index 6dea26785..4f7ce9a1f 100644 --- a/ironic/tests/unit/drivers/modules/test_agent_base.py +++ b/ironic/tests/unit/drivers/modules/test_agent_base.py @@ -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) |