Fix boot mode detection for partition images

Previously, partition images were hard coded to be bios based
as opposed to consulting all of the values AND the node itself
before making the most appropriate determination. Now the agent
utilises the internal helper to properly determine the boot
mode when calling ironic-lib.
Story: 2008070
Task: 41265
Change-Id: Id5eeda69d5b9de2b393af414472d57b0d4380c43
This commit is contained in:
Julia Kreger
2020年11月12日 06:56:10 -08:00
committed by Dmitry Tantsur
parent 246e0cf29e
commit 4fb8163717

View File

@@ -160,7 +160,7 @@ def _write_partition_image(image, image_info, device):
preserve_ep = image_info['preserve_ephemeral']
configdrive = image_info['configdrive']
boot_option = image_info.get('boot_option', 'local')
boot_mode = image_info.get('deploy_boot_mode', 'bios')
boot_mode = utils.get_node_boot_mode(cached_node)
disk_label = utils.get_partition_table_type_from_specs(cached_node)
root_mb = image_info['root_mb']

View File

@@ -1364,6 +1364,7 @@ class TestStandbyExtension(base.IronicAgentTest):
result = self.agent_extension.get_partition_uuids()
self.assertEqual({'1': '2'}, result.serialize()['command_result'])
@mock.patch.object(utils, 'get_node_boot_mode', lambda self: 'uefi')
@mock.patch.object(utils, 'get_partition_table_type_from_specs',
lambda self: 'gpt')
@mock.patch.object(hardware, 'dispatch_to_managers', autospec=True)
@@ -1386,7 +1387,6 @@ class TestStandbyExtension(base.IronicAgentTest):
node_uuid = image_info['node_uuid']
pr_ep = image_info['preserve_ephemeral']
configdrive = image_info['configdrive']
boot_mode = image_info['deploy_boot_mode']
boot_option = image_info['boot_option']
cpu_arch = self.fake_cpu.architecture
@@ -1408,7 +1408,7 @@ class TestStandbyExtension(base.IronicAgentTest):
node_uuid,
configdrive=configdrive,
preserve_ephemeral=pr_ep,
boot_mode=boot_mode,
boot_mode='uefi',
boot_option=boot_option,
disk_label='gpt',
cpu_arch=cpu_arch)
Reference in New Issue
openstack/ironic-python-agent
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.