summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/redfish/management.py
diff options
context:
space:
mode:
authorDmitry Tantsur <dtantsur@protonmail.com>2021-01-20 12:11:54 +0100
committerDmitry Tantsur <dtantsur@protonmail.com>2021-01-28 16:41:45 +0100
commit121b3348c813eb075ca38bd264a9315ee3acc2fe (patch)
treed5d142ae8da3cf56a4bb198c2d42ccc9ba5bbcd0 /ironic/drivers/modules/redfish/management.py
parentfd34d3c437e15dd53c0acac39bdf600123fbb1de (diff)
downloadironic-121b3348c813eb075ca38bd264a9315ee3acc2fe.tar.gz
Refactor vendor detection and add Redfish implementation
Get rid of the TODO in the code and prepare for more management interfaces supporting detect_vendor(). Vendor detecting now runs during transition to manageable and on power state sync (essentially same as before but for all drivers not only IPMI). Update the IPMI implementation to no longer hide exceptions since they're not handled on the upper level. Simplify the regex and fix the docstring. Add the Redfish implementation as a foundation for future vendor-specific changes. Change-Id: Ie521cf2295613dde5842cbf9a053540a40be4b9c
Diffstat (limited to 'ironic/drivers/modules/redfish/management.py')
-rw-r--r--ironic/drivers/modules/redfish/management.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ironic/drivers/modules/redfish/management.py b/ironic/drivers/modules/redfish/management.py
index 2e89d0aa1..9d49a21eb 100644
--- a/ironic/drivers/modules/redfish/management.py
+++ b/ironic/drivers/modules/redfish/management.py
@@ -677,6 +677,21 @@ class RedfishManagement(base.ManagementInterface):
'component': component,
'uuid': task.node.uuid})
+ def detect_vendor(self, task):
+ """Detects and returns the hardware vendor.
+
+ Uses the System's Manufacturer field.
+
+ :param task: A task from TaskManager.
+ :raises: InvalidParameterValue if an invalid component, indicator
+ or state is specified.
+ :raises: MissingParameterValue if a required parameter is missing
+ :raises: RedfishError on driver-specific problems.
+ :returns: String representing the BMC reported Vendor or
+ Manufacturer, otherwise returns None.
+ """
+ return redfish_utils.get_system(task.node).manufacturer
+
@METRICS.timer('RedfishManagement.update_firmware')
@base.clean_step(priority=0, abortable=False, argsinfo={
'firmware_images': {