From 9076f185ca40e7629523b926ddf817da1ca6b4a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aija=20Jaunt=C4=93va?= Date: Fri, 10 Dec 2021 11:00:24 -0500 Subject: [PATCH] Fix redfish update_firmware for newer Sushy `TaskMonitor.task_monitor` is deprecated and was removed from sushy at Ie48fab19199c0c2f3455d2212d50460a29685eed. Somehow missed to update it for `redfish` firmware upgrade steps previously. Change-Id: Iced8e921335995e1e084d6e632c6e81d3fc9249f --- ironic/drivers/modules/redfish/management.py | 2 +- ironic/tests/unit/drivers/modules/redfish/test_management.py | 4 ++-- .../notes/fix-redfish-firmware-upgrade-7ef2fcb6bfd74e67.yaml | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/fix-redfish-firmware-upgrade-7ef2fcb6bfd74e67.yaml diff --git a/ironic/drivers/modules/redfish/management.py b/ironic/drivers/modules/redfish/management.py index 6839e38c6f..b3517656c2 100644 --- a/ironic/drivers/modules/redfish/management.py +++ b/ironic/drivers/modules/redfish/management.py @@ -807,7 +807,7 @@ 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 + firmware_update['task_monitor'] = task_monitor.task_monitor_uri driver_internal_info['firmware_updates'] = firmware_updates node.driver_internal_info = driver_internal_info diff --git a/ironic/tests/unit/drivers/modules/redfish/test_management.py b/ironic/tests/unit/drivers/modules/redfish/test_management.py index 738bd8802b..5930816ab8 100644 --- a/ironic/tests/unit/drivers/modules/redfish/test_management.py +++ b/ironic/tests/unit/drivers/modules/redfish/test_management.py @@ -830,7 +830,7 @@ class RedfishManagementTestCase(db_base.DbTestCase): build_mock): build_mock.return_value = {'a': 'b'} mock_task_monitor = mock.Mock() - mock_task_monitor.task_monitor = '/task/123' + mock_task_monitor.task_monitor_uri = '/task/123' mock_update_service = mock.Mock() mock_update_service.simple_update.return_value = mock_task_monitor mock_get_update_service.return_value = mock_update_service @@ -1204,7 +1204,7 @@ class RedfishManagementTestCase(db_base.DbTestCase): mock_node_power_action, mock_log): mock_task_monitor = mock.Mock() - mock_task_monitor.task_monitor = '/task/987' + mock_task_monitor.task_monitor_uri = '/task/987' mock_update_service = mock.Mock() mock_update_service.simple_update.return_value = mock_task_monitor driver_internal_info = { diff --git a/releasenotes/notes/fix-redfish-firmware-upgrade-7ef2fcb6bfd74e67.yaml b/releasenotes/notes/fix-redfish-firmware-upgrade-7ef2fcb6bfd74e67.yaml new file mode 100644 index 0000000000..be6227811a --- /dev/null +++ b/releasenotes/notes/fix-redfish-firmware-upgrade-7ef2fcb6bfd74e67.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes ``redfish`` hardware type ``update_firmware`` cleaning step to work + with Sushy version 4.0.0 or greater.