Merge "Fix redfish detach generic vmedia device method"

This commit is contained in:
Zuul 2024-04-09 14:57:28 +00:00 committed by Gerrit Code Review
commit 604ff49456
2 changed files with 14 additions and 3 deletions

View File

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

View File

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