summaryrefslogtreecommitdiff
path: root/ironic/drivers/modules/redfish
diff options
context:
space:
mode:
Diffstat (limited to 'ironic/drivers/modules/redfish')
-rw-r--r--ironic/drivers/modules/redfish/bios.py42
-rw-r--r--ironic/drivers/modules/redfish/boot.py6
-rw-r--r--ironic/drivers/modules/redfish/raid.py10
3 files changed, 29 insertions, 29 deletions
diff --git a/ironic/drivers/modules/redfish/bios.py b/ironic/drivers/modules/redfish/bios.py
index c2eb8fcbc..44742795e 100644
--- a/ironic/drivers/modules/redfish/bios.py
+++ b/ironic/drivers/modules/redfish/bios.py
@@ -19,7 +19,6 @@ from oslo_utils import importutils
from ironic.common import exception
from ironic.common.i18n import _
from ironic.common import states
-from ironic.conductor import task_manager
from ironic.conductor import utils as manager_utils
from ironic.drivers import base
from ironic.drivers.modules import deploy_utils
@@ -55,20 +54,23 @@ class RedfishBIOS(base.BIOSInterface):
driver='redfish',
reason=_("Unable to import the sushy library"))
- def _parse_allowable_values(self, allowable_values):
+ def _parse_allowable_values(self, node, allowable_values):
"""Convert the BIOS registry allowable_value list to expected strings
:param allowable_values: list of dicts of valid values for enumeration
:returns: list containing only allowable value names
"""
- # Get name from ValueName if it exists, otherwise use DisplayValueName
+ # Get name from ValueName if it exists, otherwise use ValueDisplayName
new_list = []
for dic in allowable_values:
- for key in dic:
- if key == 'ValueName' or key == 'DisplayValueName':
- new_list.append(dic[key])
- break
+ key = dic.get('ValueName') or dic.get('ValueDisplayName')
+ if key:
+ new_list.append(key)
+ else:
+ LOG.warning('Cannot detect the value name for enumeration '
+ 'item %(item)s for node %(node)s',
+ {'item': dic, 'node': node.uuid})
return new_list
@@ -130,7 +132,8 @@ class RedfishBIOS(base.BIOSInterface):
setting[k] = getattr(reg, k, None)
if k == "allowable_values" and isinstance(setting[k],
list):
- setting[k] = self._parse_allowable_values(setting[k])
+ setting[k] = self._parse_allowable_values(
+ task.node, setting[k])
LOG.debug('Cache BIOS settings for node %(node_uuid)s',
{'node_uuid': task.node.uuid})
@@ -185,9 +188,8 @@ class RedfishBIOS(base.BIOSInterface):
LOG.error(error_msg)
raise exception.RedfishError(error=error_msg)
- self.post_reset(task)
self._set_reboot(task)
- return deploy_utils.get_async_step_return_state(task.node)
+ return self.post_reset(task)
else:
current_attrs = bios.attributes
LOG.debug('Post factory reset, BIOS configuration for node '
@@ -244,9 +246,8 @@ class RedfishBIOS(base.BIOSInterface):
LOG.error(error_msg)
raise exception.RedfishError(error=error_msg)
- self.post_configuration(task, settings)
self._set_reboot_requested(task, attributes)
- return deploy_utils.get_async_step_return_state(task.node)
+ return self.post_configuration(task, settings)
else:
# Step 2: Verify requested BIOS settings applied
requested_attrs = info.get('requested_bios_attrs')
@@ -267,8 +268,7 @@ class RedfishBIOS(base.BIOSInterface):
:param task: a TaskManager instance containing the node to act on.
"""
- deploy_utils.prepare_agent_boot(task)
- self._reboot(task)
+ return deploy_utils.reboot_to_finish_step(task)
def post_configuration(self, task, settings):
"""Perform post configuration action to store the BIOS settings.
@@ -281,8 +281,7 @@ class RedfishBIOS(base.BIOSInterface):
:param task: a TaskManager instance containing the node to act on.
:param settings: a list of BIOS settings to be updated.
"""
- deploy_utils.prepare_agent_boot(task)
- self._reboot(task)
+ return deploy_utils.reboot_to_finish_step(task)
def get_properties(self):
"""Return the properties of the interface.
@@ -322,17 +321,6 @@ class RedfishBIOS(base.BIOSInterface):
LOG.debug('Verification of BIOS settings for node %(node_uuid)s '
'successful.', {'node_uuid': task.node.uuid})
- @task_manager.require_exclusive_lock
- def _reboot(self, task):
- """Reboot the target Redfish service.
-
- :param task: a TaskManager instance containing the node to act on.
- :raises: InvalidParameterValue when the wrong state is specified
- or the wrong driver info is specified.
- :raises: RedfishError on an error from the Sushy library
- """
- manager_utils.node_power_action(task, states.REBOOT)
-
def _set_reboot(self, task):
"""Set driver_internal_info flags for deployment or cleaning reboot.
diff --git a/ironic/drivers/modules/redfish/boot.py b/ironic/drivers/modules/redfish/boot.py
index 164425eee..a321c08ec 100644
--- a/ironic/drivers/modules/redfish/boot.py
+++ b/ironic/drivers/modules/redfish/boot.py
@@ -53,7 +53,11 @@ OPTIONAL_PROPERTIES = {
"used by ironic when building UEFI-bootable ISO "
"out of kernel and ramdisk. Required for UEFI "
"when deploy_iso is not provided."),
-
+ 'external_http_url': _("External URL that is used when the image could "
+ "be served outside of the provisioning network. "
+ "If set it will have priority over the following "
+ "configs: CONF.deploy.external_http_url and "
+ "CONF.deploy.http_url. Defaults to None.")
}
RESCUE_PROPERTIES = {
diff --git a/ironic/drivers/modules/redfish/raid.py b/ironic/drivers/modules/redfish/raid.py
index 77abdef0e..809ec59c6 100644
--- a/ironic/drivers/modules/redfish/raid.py
+++ b/ironic/drivers/modules/redfish/raid.py
@@ -693,6 +693,7 @@ def update_raid_config(node):
"""
system = redfish_utils.get_system(node)
logical_disks = []
+ vol_no_raid_type = []
for stor in system.storage.get_members():
for vol in stor.volumes.get_members():
if vol.raid_type:
@@ -705,7 +706,14 @@ def update_raid_config(node):
key for key, value in RAID_LEVELS.items()
if value['raid_type'] == vol.raid_type.value)
}
- logical_disks.append(logical_disk)
+ logical_disks.append(logical_disk)
+ else:
+ vol_no_raid_type.append(vol.identity)
+
+ if vol_no_raid_type:
+ LOG.warning("Unable to update raid_config for volumes missing RAID "
+ "type: %(vol_no_raid_type)s",
+ {'vol_no_raid_type': ", ".join(vol_no_raid_type)})
raid_common.update_raid_info(node, {'logical_disks': logical_disks})