Merge "Fix redfish-virtual-media boot mode handling ordering" into stable/victoria
This commit is contained in:
commit
7855be1426
|
@ -505,6 +505,8 @@ class RedfishVirtualMediaBoot(base.BootInterface):
|
|||
"""
|
||||
node = task.node
|
||||
|
||||
boot_mode_utils.sync_boot_mode(task)
|
||||
|
||||
boot_option = deploy_utils.get_boot_option(node)
|
||||
self.clean_up_instance(task)
|
||||
iwdi = node.driver_internal_info.get('is_whole_disk_image')
|
||||
|
@ -536,8 +538,6 @@ class RedfishVirtualMediaBoot(base.BootInterface):
|
|||
_eject_vmedia(task, sushy.VIRTUAL_MEDIA_CD)
|
||||
_insert_vmedia(task, iso_ref, sushy.VIRTUAL_MEDIA_CD)
|
||||
|
||||
boot_mode_utils.sync_boot_mode(task)
|
||||
|
||||
self._set_boot_device(task, boot_devices.CDROM, persistent=True)
|
||||
|
||||
LOG.debug("Node %(node)s is set to permanently boot from "
|
||||
|
|
|
@ -700,12 +700,13 @@ class RedfishVirtualMediaBootTestCase(db_base.DbTestCase):
|
|||
|
||||
mock_boot_mode_utils.sync_boot_mode.assert_called_once_with(task)
|
||||
|
||||
@mock.patch.object(boot_mode_utils, 'sync_boot_mode', autospec=True)
|
||||
@mock.patch.object(redfish_boot, '_eject_vmedia', autospec=True)
|
||||
@mock.patch.object(image_utils, 'cleanup_iso_image', autospec=True)
|
||||
@mock.patch.object(redfish_boot, 'manager_utils', autospec=True)
|
||||
def _test_prepare_instance_local_boot(
|
||||
self, mock_manager_utils,
|
||||
mock_cleanup_iso_image, mock__eject_vmedia):
|
||||
mock_cleanup_iso_image, mock__eject_vmedia, mock_sync_boot_mode):
|
||||
|
||||
with task_manager.acquire(self.context, self.node.uuid,
|
||||
shared=True) as task:
|
||||
|
@ -720,6 +721,7 @@ class RedfishVirtualMediaBootTestCase(db_base.DbTestCase):
|
|||
mock_cleanup_iso_image.assert_called_once_with(task)
|
||||
mock__eject_vmedia.assert_called_once_with(
|
||||
task, sushy.VIRTUAL_MEDIA_CD)
|
||||
mock_sync_boot_mode.assert_called_once_with(task)
|
||||
|
||||
def test_prepare_instance_local_whole_disk_image(self):
|
||||
self.node.driver_internal_info = {'is_whole_disk_image': True}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Boot mode is now correctly handled when using ``redfish-virtual-media``
|
||||
boot with locally booted images.
|
Loading…
Reference in New Issue