From f86975d53c2b25129c22e83cc54f17b41c9b21eb Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Thu, 31 Aug 2023 06:35:39 -0700 Subject: [PATCH] Add mlnx deploy_step entry to enable deploy time firmware Follow-up from service steps addition change to add a deploy steps alias for the Nvidia Mellanox network device firmware update clean steps. This allows deploy time firmware updates to be codified as part of a deployment with custom steps. Change-Id: I9d80447dee7cfde4d3f8d81d9d39e738916b7824 --- ironic_python_agent/hardware_managers/mlnx.py | 5 +++-- .../tests/unit/hardware_managers/test_mlnx.py | 4 ++++ ...lnx-steps-now-available-for-deploy-4a4226ffaae888f3.yaml | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/mlnx-steps-now-available-for-deploy-4a4226ffaae888f3.yaml diff --git a/ironic_python_agent/hardware_managers/mlnx.py b/ironic_python_agent/hardware_managers/mlnx.py index 37ac7dfaa..5d98b7da3 100644 --- a/ironic_python_agent/hardware_managers/mlnx.py +++ b/ironic_python_agent/hardware_managers/mlnx.py @@ -163,8 +163,9 @@ class MellanoxDeviceHardwareManager(hardware.HardwareManager): # NOTE(TheJulia): Since these steps can be run upon service, why not return self.get_clean_steps(node, ports) - # TODO(TheJulia): Should there be a get_deploy_steps handler here? Since - # flashing firmware on deploy is a valid case. + def get_deploy_steps(self, node, ports): + """Alias wrapper for method get_clean_steps.""" + return self.get_clean_steps(node, ports) def update_nvidia_nic_firmware_image(self, node, ports, images): nvidia_fw_update.update_nvidia_nic_firmware_image(images) diff --git a/ironic_python_agent/tests/unit/hardware_managers/test_mlnx.py b/ironic_python_agent/tests/unit/hardware_managers/test_mlnx.py index dbfb41ea1..46bc9966c 100755 --- a/ironic_python_agent/tests/unit/hardware_managers/test_mlnx.py +++ b/ironic_python_agent/tests/unit/hardware_managers/test_mlnx.py @@ -77,6 +77,10 @@ class MlnxHardwareManager(base.IronicAgentTest): 'step': 'update_nvidia_nic_firmware_settings'}] self.assertEqual(self.hardware.get_clean_steps(self.node, []), expected_clean_steps) + self.assertEqual(self.hardware.get_service_steps(self.node, []), + expected_clean_steps) + self.assertEqual(self.hardware.get_deploy_steps(self.node, []), + expected_clean_steps) @mock.patch.object(os, 'listdir', autospec=True) @mock.patch.object(hardware, '_get_device_info', autospec=True) diff --git a/releasenotes/notes/mlnx-steps-now-available-for-deploy-4a4226ffaae888f3.yaml b/releasenotes/notes/mlnx-steps-now-available-for-deploy-4a4226ffaae888f3.yaml new file mode 100644 index 000000000..8cddc4bdf --- /dev/null +++ b/releasenotes/notes/mlnx-steps-now-available-for-deploy-4a4226ffaae888f3.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + The Nvidia Mellanox "clean steps" to facilitate firmware updates of + their network devices, are now available as deploy steps and service + steps as well.