diff options
author | Aija Jauntēva <aija.jaunteva@dell.com> | 2021-05-19 11:39:03 -0400 |
---|---|---|
committer | Aija Jauntēva <aija.jaunteva@dell.com> | 2021-08-30 04:46:43 -0400 |
commit | fbb0020ab70541fd8762c7551f3cbb9e3c06b7ee (patch) | |
tree | 51bdf7623480e5458de268e48cf0e3d2e9728fae | |
parent | 183325d4643561a951fb575a7781e92643b41e67 (diff) | |
download | ironic-fbb0020ab70541fd8762c7551f3cbb9e3c06b7ee.tar.gz |
Remove manager param for iDRAC OEM calls
Methods don't need to pass manager to execute OEM
manager method because it already has that context.
This was added for backportability.
Depends-On: https://review.opendev.org/c/x/sushy-oem-idrac/+/792087
Change-Id: I67e89f72b1d847df233d2ffec51ca5e8963f51e9
-rw-r--r-- | driver-requirements.txt | 2 | ||||
-rw-r--r-- | ironic/drivers/modules/drac/boot.py | 5 | ||||
-rw-r--r-- | ironic/drivers/modules/drac/utils.py | 13 | ||||
-rw-r--r-- | ironic/tests/unit/drivers/modules/drac/test_boot.py | 9 |
4 files changed, 8 insertions, 21 deletions
diff --git a/driver-requirements.txt b/driver-requirements.txt index 8b2af33a2..6b8d7a0e2 100644 --- a/driver-requirements.txt +++ b/driver-requirements.txt @@ -20,4 +20,4 @@ ansible>=2.7 python-ibmcclient>=0.2.2,<0.3.0 # Dell EMC iDRAC sushy OEM extension -sushy-oem-idrac>=2.1.0,<3.0.0 +sushy-oem-idrac>=3.0.0,<4.0.0 diff --git a/ironic/drivers/modules/drac/boot.py b/ironic/drivers/modules/drac/boot.py index 94efc65b9..1e2f30dc0 100644 --- a/ironic/drivers/modules/drac/boot.py +++ b/ironic/drivers/modules/drac/boot.py @@ -106,6 +106,5 @@ class DracRedfishVirtualMediaBoot(redfish_boot.RedfishVirtualMediaBoot): drac_utils.execute_oem_manager_method( task, 'set virtual boot device', - lambda m, manager: m.set_virtual_boot_device( - device, persistent=persistent, system=system, - manager=manager), pass_manager=True) + lambda m: m.set_virtual_boot_device( + device, persistent=persistent, system=system)) diff --git a/ironic/drivers/modules/drac/utils.py b/ironic/drivers/modules/drac/utils.py index 21073d56e..e36c8fad8 100644 --- a/ironic/drivers/modules/drac/utils.py +++ b/ironic/drivers/modules/drac/utils.py @@ -24,7 +24,7 @@ sushy = importutils.try_import('sushy') def execute_oem_manager_method( - task, process_name, lambda_oem_func, pass_manager=False): + task, process_name, lambda_oem_func): """Loads OEM manager and executes passed method on it. Known iDRAC Redfish systems has only one manager, but as Redfish @@ -38,12 +38,6 @@ def execute_oem_manager_method( :param lambda_oem_func: method to execute as lambda function with input parameter OEM extension manager. Example: lambda m: m.reset_idrac() - For older versions also support second input parameter Redfish - manager itself when pass_manager set to True. - :param pass_manager: whether to pass manager itself to executed - OEM extension method. This is for backward compability, new - functions must not pass manager, but acquire it internally. Will - be removed in future. :returns: Returned value of lambda_oem_func :raises: RedfishError if can't execute OEM function either because there are no managers to the system, failed to load OEM @@ -82,10 +76,7 @@ def execute_oem_manager_method( raise exception.RedfishError(error=error_msg) try: - if pass_manager: - result = lambda_oem_func(manager_oem, manager) - else: - result = lambda_oem_func(manager_oem) + result = lambda_oem_func(manager_oem) LOG.info("Completed: %(process_name)s with system %(system)s " "manager %(manager)s for node %(node)s", {'process_name': process_name, diff --git a/ironic/tests/unit/drivers/modules/drac/test_boot.py b/ironic/tests/unit/drivers/modules/drac/test_boot.py index 92ff32d81..66d01d8c3 100644 --- a/ironic/tests/unit/drivers/modules/drac/test_boot.py +++ b/ironic/tests/unit/drivers/modules/drac/test_boot.py @@ -77,8 +77,7 @@ class DracBootTestCase(test_utils.BaseDracTest): task, boot_devices.CDROM, persistent=True) mock_manager_oem.set_virtual_boot_device.assert_called_once_with( - 'cd', persistent=True, manager=mock_manager, - system=mock_system) + 'cd', persistent=True, system=mock_system) def test__set_boot_device_cd(self, mock_get_system): mock_system = mock_get_system.return_value @@ -91,8 +90,7 @@ class DracBootTestCase(test_utils.BaseDracTest): task.driver.boot._set_boot_device(task, boot_devices.CDROM) mock_manager_oem.set_virtual_boot_device.assert_called_once_with( - 'cd', persistent=False, manager=mock_manager, - system=mock_system) + 'cd', persistent=False, system=mock_system) def test__set_boot_device_floppy(self, mock_get_system): mock_system = mock_get_system.return_value @@ -105,8 +103,7 @@ class DracBootTestCase(test_utils.BaseDracTest): task.driver.boot._set_boot_device(task, boot_devices.FLOPPY) mock_manager_oem.set_virtual_boot_device.assert_called_once_with( - 'floppy', persistent=False, manager=mock_manager, - system=mock_system) + 'floppy', persistent=False, system=mock_system) def test__set_boot_device_disk(self, mock_get_system): mock_system = mock_get_system.return_value |