Merge "Do not assume sushy constants are strings - part 2"

This commit is contained in:
Zuul 2021-11-26 11:25:49 +00:00 committed by Gerrit Code Review
commit 9b6b491552
2 changed files with 5 additions and 4 deletions

View File

@ -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:

View File

@ -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