summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/redfish/management.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2021-11-04 18:12:34 +0100
committerDmitry Tantsur <dtantsur@protonmail.com>2021-11-09 18:00:35 +0100
commit815705bc7deb877c2efaee750bbfaabcd3e635ff (patch)
treec3796e00b1b0def971a2ca10a65a9632846e044c /ironic/drivers/modules/redfish/management.py
parent4bb7e537386811189b9f519b2f51588d5caef94c (diff)
downloadironic-815705bc7deb877c2efaee750bbfaabcd3e635ff.tar.gz
Fix RedfishManagement.get_mac_addresses and related functions
RedfishManagement.get_mac_addresses has two problems: * It returns a dict while the base class documents returning a list * The dict's values are Redfish-specific values This change fixes this function to return a list and significantly simplifies the related create_ports_if_not_exists. Change-Id: I329cabe04662d0d668d4c3e04ecede5b4fdec6c6
Diffstat (limited to 'ironic/drivers/modules/redfish/management.py')
-rw-r--r--ironic/drivers/modules/redfish/management.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/ironic/drivers/modules/redfish/management.py b/ironic/drivers/modules/redfish/management.py
index 29844fae9..5a94d1564 100644
--- a/ironic/drivers/modules/redfish/management.py
+++ b/ironic/drivers/modules/redfish/management.py
@@ -1114,12 +1114,11 @@ class RedfishManagement(base.ManagementInterface):
:param task: A TaskManager instance containing the node to act on.
:raises: RedfishConnectionError when it fails to connect to Redfish
:raises: RedfishError on an error from the Sushy library
- :returns: a dictionary containing MAC addresses of enabled interfaces
- in a {'mac': 'state'} format
+ :returns: A list of MAC addresses for the node
"""
try:
system = redfish_utils.get_system(task.node)
- return redfish_utils.get_enabled_macs(task, system)
+ return list(redfish_utils.get_enabled_macs(task, system))
except sushy.exceptions.SushyError as exc:
msg = (_('Failed to get network interface information on node '
'%(node)s: %(exc)s')