Merge "Handle default_boot_mode during cleaning/inspection with PXE/iPXE"
This commit is contained in:
commit
235506b001
@ -284,7 +284,8 @@ def get_boot_mode(node):
|
|||||||
return boot_mode
|
return boot_mode
|
||||||
# TODO(hshiina): The default boot mode will be changed to UEFI.
|
# TODO(hshiina): The default boot mode will be changed to UEFI.
|
||||||
global warn_about_default_boot_mode
|
global warn_about_default_boot_mode
|
||||||
if not warn_about_default_boot_mode:
|
if (not warn_about_default_boot_mode
|
||||||
|
and CONF.deploy.default_boot_mode == boot_modes.LEGACY_BIOS):
|
||||||
warn_about_default_boot_mode = True
|
warn_about_default_boot_mode = True
|
||||||
LOG.warning('Boot mode is not configured for node %(node_uuid)s '
|
LOG.warning('Boot mode is not configured for node %(node_uuid)s '
|
||||||
'explicitly. The default boot mode is "%(bios)s", but, '
|
'explicitly. The default boot mode is "%(bios)s", but, '
|
||||||
@ -294,4 +295,4 @@ def get_boot_mode(node):
|
|||||||
{'node_uuid': node.uuid,
|
{'node_uuid': node.uuid,
|
||||||
'bios': boot_modes.LEGACY_BIOS,
|
'bios': boot_modes.LEGACY_BIOS,
|
||||||
'uefi': boot_modes.UEFI})
|
'uefi': boot_modes.UEFI})
|
||||||
return boot_modes.LEGACY_BIOS
|
return CONF.deploy.default_boot_mode
|
||||||
|
@ -191,6 +191,7 @@ class PXEBaseMixin(object):
|
|||||||
pxe_info.update(
|
pxe_info.update(
|
||||||
pxe_utils.get_instance_image_info(
|
pxe_utils.get_instance_image_info(
|
||||||
task, ipxe_enabled=self.ipxe_enabled))
|
task, ipxe_enabled=self.ipxe_enabled))
|
||||||
|
|
||||||
boot_mode_utils.sync_boot_mode(task)
|
boot_mode_utils.sync_boot_mode(task)
|
||||||
|
|
||||||
pxe_options = pxe_utils.build_pxe_config_options(
|
pxe_options = pxe_utils.build_pxe_config_options(
|
||||||
|
@ -53,3 +53,14 @@ class GetBootModeTestCase(tests_base.TestCase):
|
|||||||
boot_mode = boot_mode_utils.get_boot_mode(self.node)
|
boot_mode = boot_mode_utils.get_boot_mode(self.node)
|
||||||
self.assertEqual(boot_modes.LEGACY_BIOS, boot_mode)
|
self.assertEqual(boot_modes.LEGACY_BIOS, boot_mode)
|
||||||
self.assertEqual(1, mock_log.warning.call_count)
|
self.assertEqual(1, mock_log.warning.call_count)
|
||||||
|
|
||||||
|
@mock.patch.object(boot_mode_utils, 'LOG', autospec=True)
|
||||||
|
@mock.patch.object(boot_mode_utils, 'get_boot_mode_for_deploy',
|
||||||
|
autospec=True)
|
||||||
|
def test_get_boot_mode_default_set(self, mock_for_deploy, mock_log):
|
||||||
|
self.config(default_boot_mode='uefi', group='deploy')
|
||||||
|
boot_mode_utils.warn_about_default_boot_mode = False
|
||||||
|
mock_for_deploy.return_value = None
|
||||||
|
boot_mode = boot_mode_utils.get_boot_mode(self.node)
|
||||||
|
self.assertEqual(boot_modes.UEFI, boot_mode)
|
||||||
|
self.assertEqual(0, mock_log.warning.call_count)
|
||||||
|
@ -276,7 +276,6 @@ class PXEBootTestCase(db_base.DbTestCase):
|
|||||||
mode=mode,
|
mode=mode,
|
||||||
ipxe_enabled=False)
|
ipxe_enabled=False)
|
||||||
provider_mock.update_dhcp.assert_called_once_with(task, dhcp_opts)
|
provider_mock.update_dhcp.assert_called_once_with(task, dhcp_opts)
|
||||||
if self.node.provision_state == states.DEPLOYING:
|
|
||||||
get_boot_mode_mock.assert_called_once_with(task)
|
get_boot_mode_mock.assert_called_once_with(task)
|
||||||
set_boot_device_mock.assert_called_once_with(task,
|
set_boot_device_mock.assert_called_once_with(task,
|
||||||
boot_devices.PXE,
|
boot_devices.PXE,
|
||||||
|
9
releasenotes/notes/pxe-boot-mode-9084ccf35e54bbc0.yaml
Normal file
9
releasenotes/notes/pxe-boot-mode-9084ccf35e54bbc0.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixes cleaning and managed inspection not respecting the
|
||||||
|
``default_boot_mode`` configuration option.
|
||||||
|
- |
|
||||||
|
Fixes cleaning and managed inspection not following the standard boot
|
||||||
|
mode handling logic, particularly, not trying to assert the requested
|
||||||
|
boot mode if the driver allows it.
|
Loading…
Reference in New Issue
Block a user