Browse Source

Merge "Use driver_internal_info methods for redfish driver"

changes/01/823701/3
Zuul 4 months ago committed by Gerrit Code Review
parent
commit
a27a267d6d
  1. 23
      ironic/drivers/modules/redfish/bios.py
  2. 14
      ironic/drivers/modules/redfish/management.py
  3. 12
      ironic/drivers/modules/redfish/raid.py

23
ironic/drivers/modules/redfish/bios.py

@ -338,9 +338,8 @@ class RedfishBIOS(base.BIOSInterface):
:param task: a TaskManager instance containing the node to act on.
"""
info = task.node.driver_internal_info
info['post_factory_reset_reboot_requested'] = True
task.node.driver_internal_info = info
task.node.set_driver_internal_info(
'post_factory_reset_reboot_requested', True)
task.node.save()
deploy_utils.set_async_step_flags(task.node, reboot=True,
skip_current_step=False)
@ -351,10 +350,9 @@ class RedfishBIOS(base.BIOSInterface):
:param task: a TaskManager instance containing the node to act on.
:param attributes: the requested BIOS attributes to update.
"""
info = task.node.driver_internal_info
info['post_config_reboot_requested'] = True
info['requested_bios_attrs'] = attributes
task.node.driver_internal_info = info
task.node.set_driver_internal_info('post_config_reboot_requested',
True)
task.node.set_driver_internal_info('requested_bios_attrs', attributes)
task.node.save()
deploy_utils.set_async_step_flags(task.node, reboot=True,
skip_current_step=False)
@ -364,12 +362,11 @@ class RedfishBIOS(base.BIOSInterface):
:param task: a TaskManager instance containing the node to act on.
"""
info = task.node.driver_internal_info
info.pop('post_config_reboot_requested', None)
info.pop('post_factory_reset_reboot_requested', None)
info.pop('requested_bios_attrs', None)
task.node.driver_internal_info = info
task.node.save()
node = task.node
node.del_driver_internal_info('post_config_reboot_requested')
node.del_driver_internal_info('post_factory_reset_reboot_requested')
node.del_driver_internal_info('requested_bios_attrs')
node.save()
def _set_step_failed(self, task, attrs_not_updated):
"""Fail the cleaning or deployment step and log the error.

14
ironic/drivers/modules/redfish/management.py

@ -806,10 +806,9 @@ class RedfishManagement(base.ManagementInterface):
task_monitor = update_service.simple_update(firmware_url)
driver_internal_info = node.driver_internal_info
firmware_update['task_monitor'] = task_monitor.task_monitor_uri
driver_internal_info['firmware_updates'] = firmware_updates
node.driver_internal_info = driver_internal_info
node.set_driver_internal_info('firmware_updates',
firmware_updates)
def _continue_firmware_updates(self, task, update_service,
firmware_updates):
@ -838,9 +837,8 @@ class RedfishManagement(base.ManagementInterface):
'firmware_image': firmware_update['url'],
'node': node.uuid})
driver_internal_info = node.driver_internal_info
driver_internal_info['firmware_updates'] = firmware_updates
node.driver_internal_info = driver_internal_info
node.set_driver_internal_info('firmware_updates',
firmware_updates)
node.save()
return
@ -866,9 +864,7 @@ class RedfishManagement(base.ManagementInterface):
:param node: the node to clear the firmware updates from
"""
driver_internal_info = node.driver_internal_info
driver_internal_info.pop('firmware_updates', None)
node.driver_internal_info = driver_internal_info
node.del_driver_internal_info('firmware_updates')
node.save()
@METRICS.timer('RedfishManagement._query_firmware_update_failed')

12
ironic/drivers/modules/redfish/raid.py

@ -841,9 +841,7 @@ class RedfishRAID(base.RAIDInterface):
reboot_required = True
raid_configs.append(raid_config)
driver_internal_info = node.driver_internal_info
driver_internal_info['raid_configs'] = raid_configs
node.driver_internal_info = driver_internal_info
node.set_driver_internal_info('raid_configs', raid_configs)
return_state = None
deploy_utils.set_async_step_flags(
@ -914,9 +912,7 @@ class RedfishRAID(base.RAIDInterface):
reboot_required = True
raid_configs.append(raid_config)
driver_internal_info = node.driver_internal_info
driver_internal_info['raid_configs'] = raid_configs
node.driver_internal_info = driver_internal_info
node.set_driver_internal_info('raid_configs', raid_configs)
return_state = None
deploy_utils.set_async_step_flags(
@ -1007,9 +1003,7 @@ class RedfishRAID(base.RAIDInterface):
:param node: the node to clear the RAID configs from
"""
driver_internal_info = node.driver_internal_info
driver_internal_info.pop('raid_configs', None)
node.driver_internal_info = driver_internal_info
node.del_driver_internal_info('raid_configs')
node.save()
@METRICS.timer('RedfishRAID._query_raid_config_failed')

Loading…
Cancel
Save