summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/redfish/management.py
diff options
context:
space:
mode:
authorSteve Baker <sbaker@redhat.com>2021-03-09 15:50:24 +1300
committerJulia Kreger <juliaashleykreger@gmail.com>2021-03-19 12:54:06 -0700
commit9f221a7d42350f38bc502c1fd79232593cff7ab2 (patch)
treefa54f1290a8f579ef518cff06332047a5c505886 /ironic/drivers/modules/redfish/management.py
parentf1641468bbc586d3b50c02511159c9de44ae6a9b (diff)
downloadironic-9f221a7d42350f38bc502c1fd79232593cff7ab2.tar.gz
Allow unsupported redfish set_boot_mode
Currently if the baremetal boot mode is unknown and the driver doesn't support setting the boot mode then the error is logged and deployment continues. However if the BMC doesn't support getting or setting the boot mode then setting the boot mode raises an error which results in the deploy failing. This is the case for HPE Gen9 baremetal, which doesn't have a 'BootSourceOverrideMode' attribute in its system Boot field, and raises a 400 iLO.2.14.UnsupportedOperation in response to setting the boot mode. This is raised from set_boot_mode as a RedfishError. This change raises UnsupportedDriverExtension exception when the 'mode' attribute is missing from the 'boot' field, allowing the deployment to continue. Change-Id: I360ff8180be252de21f5fcd2208947087e332a39
Diffstat (limited to 'ironic/drivers/modules/redfish/management.py')
-rw-r--r--ironic/drivers/modules/redfish/management.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/ironic/drivers/modules/redfish/management.py b/ironic/drivers/modules/redfish/management.py
index 118829102..32233903c 100644
--- a/ironic/drivers/modules/redfish/management.py
+++ b/ironic/drivers/modules/redfish/management.py
@@ -303,6 +303,19 @@ class RedfishManagement(base.ManagementInterface):
{'node': task.node.uuid, 'mode': mode,
'error': e})
LOG.error(error_msg)
+
+ # NOTE(sbaker): Some systems such as HPE Gen9 do not support
+ # getting or setting the boot mode. When setting failed and the
+ # mode attribute is missing from the boot field, raising
+ # UnsupportedDriverExtension will allow the deploy to continue.
+ if system.boot.get('mode') is None:
+ LOG.info(_('Attempt to set boot mode on node %(node)s '
+ 'failed to set boot mode as the node does not '
+ 'appear to support overriding the boot mode. '
+ 'Possibly partial Redfish implementation?'),
+ {'node': task.node.uuid})
+ raise exception.UnsupportedDriverExtension(
+ driver=task.node.driver, extension='set_boot_mode')
raise exception.RedfishError(error=error_msg)
def get_boot_mode(self, task):