diff --git a/ironic/drivers/modules/redfish/management.py b/ironic/drivers/modules/redfish/management.py index 0037ff1dbd..64e2df002d 100644 --- a/ironic/drivers/modules/redfish/management.py +++ b/ironic/drivers/modules/redfish/management.py @@ -1349,13 +1349,17 @@ class RedfishManagement(base.ManagementInterface): redfish_boot.insert_vmedia(task, image_url, device_type) @task_manager.require_exclusive_lock - def detach_virtual_media(self, task, device_type=None): + def detach_virtual_media(self, task, device_types=None): """Detach some or all virtual media devices from the node. :param task: A task from TaskManager. - :param device_type: A device type from + :param device_types: A list of device types from :data:`ironic.common.boot_devices.VMEDIA_DEVICES`. If not provided, all devices are detached. """ - redfish_boot.eject_vmedia(task, device_type) + if device_types is None: + redfish_boot.eject_vmedia(task) + else: + for device_type in device_types: + redfish_boot.eject_vmedia(task, device_type) diff --git a/releasenotes/notes/fix-detach-vmedia-redfish-c86b7d0f72217816.yaml b/releasenotes/notes/fix-detach-vmedia-redfish-c86b7d0f72217816.yaml new file mode 100644 index 0000000000..f26da36c92 --- /dev/null +++ b/releasenotes/notes/fix-detach-vmedia-redfish-c86b7d0f72217816.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixes usage of redfish detach virtual media feature to be conform to + the general implementation. + Before the detach virtual media API call using redfish driver was not + working as intended and caused the operation to fail.