diff --git a/ironic/drivers/modules/redfish/boot.py b/ironic/drivers/modules/redfish/boot.py index 49928acdf9..47b85cc251 100644 --- a/ironic/drivers/modules/redfish/boot.py +++ b/ironic/drivers/modules/redfish/boot.py @@ -278,7 +278,7 @@ def _has_vmedia_device(managers, boot_device, inserted=None): inserted status. :return: The device that could be found or False. """ - if isinstance(boot_device, str): + if not isinstance(boot_device, list): boot_device = [boot_device] for dev in boot_device: diff --git a/ironic/tests/unit/drivers/modules/drac/test_boot.py b/ironic/tests/unit/drivers/modules/drac/test_boot.py index 66d01d8c3e..c6ab480e98 100644 --- a/ironic/tests/unit/drivers/modules/drac/test_boot.py +++ b/ironic/tests/unit/drivers/modules/drac/test_boot.py @@ -77,7 +77,7 @@ class DracBootTestCase(test_utils.BaseDracTest): task, boot_devices.CDROM, persistent=True) mock_manager_oem.set_virtual_boot_device.assert_called_once_with( - 'cd', persistent=True, system=mock_system) + sushy.VIRTUAL_MEDIA_CD, persistent=True, system=mock_system) def test__set_boot_device_cd(self, mock_get_system): mock_system = mock_get_system.return_value @@ -90,7 +90,7 @@ class DracBootTestCase(test_utils.BaseDracTest): task.driver.boot._set_boot_device(task, boot_devices.CDROM) mock_manager_oem.set_virtual_boot_device.assert_called_once_with( - 'cd', persistent=False, system=mock_system) + sushy.VIRTUAL_MEDIA_CD, persistent=False, system=mock_system) def test__set_boot_device_floppy(self, mock_get_system): mock_system = mock_get_system.return_value @@ -103,7 +103,8 @@ class DracBootTestCase(test_utils.BaseDracTest): task.driver.boot._set_boot_device(task, boot_devices.FLOPPY) mock_manager_oem.set_virtual_boot_device.assert_called_once_with( - 'floppy', persistent=False, system=mock_system) + sushy.VIRTUAL_MEDIA_FLOPPY, persistent=False, + system=mock_system) def test__set_boot_device_disk(self, mock_get_system): mock_system = mock_get_system.return_value