Merge "Make redfish-virtual-media respect default_boot_mode" into stable/victoria

This commit is contained in:
Zuul 2020-11-03 13:31:47 +00:00 committed by Gerrit Code Review
commit e42eb3f6e6
3 changed files with 29 additions and 3 deletions

View File

@ -345,7 +345,7 @@ def _prepare_iso_image(task, kernel_href, ramdisk_href,
(kernel_params, ' '.join(
'%s=%s' % kv for kv in params.items())))
boot_mode = boot_mode_utils.get_boot_mode_for_deploy(task.node)
boot_mode = boot_mode_utils.get_boot_mode(task.node)
LOG.debug("Trying to create %(boot_mode)s ISO image for node %(node)s "
"with kernel %(kernel_href)s, ramdisk %(ramdisk_href)s, "

View File

@ -259,6 +259,27 @@ class RedfishImageUtilsTestCase(db_base.DbTestCase):
self.assertEqual(expected_url, url)
@mock.patch.object(image_utils.ImageHandler, 'publish_image',
autospec=True)
@mock.patch.object(images, 'create_boot_iso', autospec=True)
def test__prepare_iso_image_default_boot_mode(
self, mock_create_boot_iso, mock_publish_image):
self.config(default_boot_mode='uefi', group='deploy')
with task_manager.acquire(self.context, self.node.uuid,
shared=True) as task:
image_utils._prepare_iso_image(
task, 'http://kernel/img', 'http://ramdisk/img',
bootloader_href=None, root_uuid=task.node.uuid,
base_iso='/path/to/baseiso')
mock_create_boot_iso.assert_called_once_with(
mock.ANY, mock.ANY, 'http://kernel/img', 'http://ramdisk/img',
boot_mode='uefi', esp_image_href=None,
configdrive_href=mock.ANY,
kernel_params='nofb nomodeset vga=normal',
root_uuid='1be26c0b-03f2-4d2e-ae87-c02d7f33c123',
base_iso='/path/to/baseiso')
@mock.patch.object(image_utils.ImageHandler, 'publish_image',
autospec=True)
@mock.patch.object(images, 'create_boot_iso', autospec=True)
@ -282,7 +303,7 @@ class RedfishImageUtilsTestCase(db_base.DbTestCase):
mock_create_boot_iso.assert_called_once_with(
mock.ANY, mock.ANY, 'http://kernel/img', 'http://ramdisk/img',
boot_mode=None, esp_image_href=None,
boot_mode='bios', esp_image_href=None,
configdrive_href=mock.ANY,
kernel_params='nofb nomodeset vga=normal',
root_uuid='1be26c0b-03f2-4d2e-ae87-c02d7f33c123',
@ -308,7 +329,7 @@ class RedfishImageUtilsTestCase(db_base.DbTestCase):
mock_create_boot_iso.assert_called_once_with(
mock.ANY, mock.ANY, 'http://kernel/img', 'http://ramdisk/img',
boot_mode=None, esp_image_href=None,
boot_mode='bios', esp_image_href=None,
configdrive_href=mock.ANY,
kernel_params=kernel_params,
root_uuid='1be26c0b-03f2-4d2e-ae87-c02d7f33c123',

View File

@ -0,0 +1,5 @@
---
fixes:
- |
The virtual media ISO image building process now respects the
``default_boot_mode`` configuration option.