Merge "Fix "'NoneType' object is not iterable" in RAID" into stable/yoga

This commit is contained in:
Zuul 2023-02-15 19:30:47 +00:00 committed by Gerrit Code Review
commit e84a1f90ca
3 changed files with 17 additions and 2 deletions

View File

@ -1120,7 +1120,9 @@ class RedfishRAID(base.RAIDInterface):
raid_configs['pending'].setdefault(controller, []).append(
logical_disk)
node.set_driver_internal_info('raid_configs', raid_configs)
# Store only when async operation
if reboot_required:
node.set_driver_internal_info('raid_configs', raid_configs)
return raid_configs, reboot_required
@ -1182,7 +1184,9 @@ class RedfishRAID(base.RAIDInterface):
response.task_monitor_uri)
reboot_required = True
node.set_driver_internal_info('raid_configs', raid_configs)
# Store only when async operation
if reboot_required:
node.set_driver_internal_info('raid_configs', raid_configs)
return raid_configs, reboot_required

View File

@ -336,6 +336,8 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
self.assertEqual(mock_node_power_action.call_count, 0)
self.assertEqual(mock_build_agent_options.call_count, 0)
self.assertEqual(mock_prepare_ramdisk.call_count, 0)
self.assertIsNone(
task.node.driver_internal_info.get('raid_configs'))
self.assertEqual(
[{'controller': 'RAID controller 1',
'id': '1',
@ -1066,6 +1068,8 @@ class RedfishRAIDTestCase(db_base.DbTestCase):
self.assertEqual(mock_node_power_action.call_count, 0)
self.assertEqual(mock_build_agent_options.call_count, 0)
self.assertEqual(mock_prepare_ramdisk.call_count, 0)
self.assertIsNone(
task.node.driver_internal_info.get('raid_configs'))
self.assertEqual([], task.node.raid_config['logical_disks'])
self.assertNotEqual(
last_updated, task.node.raid_config['last_updated'])

View File

@ -0,0 +1,7 @@
---
fixes:
- |
Fixes ``'NoneType' object is not iterable`` in conductor logs for
``redfish`` and ``idrac-redfish`` RAID clean and deploy steps. The message
should no longer appear. For affected nodes re-create the node or delete
``raid_configs`` entry from ``driver_internal_info`` field.