From 805a785a3a20083bf5f198f8cfdc5387f1176c07 Mon Sep 17 00:00:00 2001 From: Riccardo Pittau Date: Fri, 15 May 2020 14:48:58 +0200 Subject: [PATCH] Change ibmcclient compatible version And fix a couple of things to adapt to latest release. Change-Id: I1cf2dadcfa66975f7f5020ca97a75ebf7b055d4a --- driver-requirements.txt | 2 +- ironic/drivers/modules/ibmc/utils.py | 2 +- ironic/tests/unit/drivers/modules/ibmc/test_utils.py | 4 ++-- ironic/tests/unit/drivers/third_party_driver_mocks.py | 4 ++-- releasenotes/notes/ibmcclient-fix-8c6cb49be0aef5f2.yaml | 4 ++++ 5 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/ibmcclient-fix-8c6cb49be0aef5f2.yaml diff --git a/driver-requirements.txt b/driver-requirements.txt index 2d8c9671c7..bb016f26ee 100644 --- a/driver-requirements.txt +++ b/driver-requirements.txt @@ -17,7 +17,7 @@ sushy>=3.2.0 ansible>=2.7 # HUAWEI iBMC hardware type uses the python-ibmcclient library -python-ibmcclient>=0.1.0,<0.2.0 +python-ibmcclient>=0.2.2,<0.3.0 # Dell EMC iDRAC sushy OEM extension sushy-oem-idrac<=1.0.0 diff --git a/ironic/drivers/modules/ibmc/utils.py b/ironic/drivers/modules/ibmc/utils.py index 0819d7874c..78bf25cb34 100644 --- a/ironic/drivers/modules/ibmc/utils.py +++ b/ironic/drivers/modules/ibmc/utils.py @@ -152,7 +152,7 @@ def handle_ibmc_exception(action): try: return f(*args, **kwargs) - except ibmc_error.ConnectionError as e: + except ibmc_error.IBMCConnectionError as e: error = (_('Failed to connect to iBMC for node %(node)s, ' 'Error: %(error)s') % {'node': node.uuid, 'error': e}) diff --git a/ironic/tests/unit/drivers/modules/ibmc/test_utils.py b/ironic/tests/unit/drivers/modules/ibmc/test_utils.py index 40f0fd2c31..f04d37e88d 100644 --- a/ironic/tests/unit/drivers/modules/ibmc/test_utils.py +++ b/ironic/tests/unit/drivers/modules/ibmc/test_utils.py @@ -144,8 +144,8 @@ class IBMCUtilsTestCase(base.IBMCTestCase): conn = self.mock_ibmc_conn(connect_ibmc) # Mocks conn.system.get.side_effect = [ - ibmc_error.ConnectionError(url=self.ibmc['address'], - error='Failed to connect to host'), + ibmc_error.IBMCConnectionError(url=self.ibmc['address'], + error='Failed to connect to host'), mock.PropertyMock( boot_source_override=mock.PropertyMock( target=constants.BOOT_SOURCE_TARGET_PXE, diff --git a/ironic/tests/unit/drivers/third_party_driver_mocks.py b/ironic/tests/unit/drivers/third_party_driver_mocks.py index 2ea71379ab..547b41c4a0 100644 --- a/ironic/tests/unit/drivers/third_party_driver_mocks.py +++ b/ironic/tests/unit/drivers/third_party_driver_mocks.py @@ -264,8 +264,8 @@ if not ibmc_client: # Mock iBMC client exceptions exceptions = mock.MagicMock() - exceptions.ConnectionError = ( - type('ConnectionError', (MockKwargsException,), {})) + exceptions.IBMCConnectionError = ( + type('IBMCConnectionError', (MockKwargsException,), {})) exceptions.IBMCClientError = ( type('IBMCClientError', (MockKwargsException,), {})) sys.modules['ibmc_client.exceptions'] = exceptions diff --git a/releasenotes/notes/ibmcclient-fix-8c6cb49be0aef5f2.yaml b/releasenotes/notes/ibmcclient-fix-8c6cb49be0aef5f2.yaml new file mode 100644 index 0000000000..bf2fdfa80a --- /dev/null +++ b/releasenotes/notes/ibmcclient-fix-8c6cb49be0aef5f2.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + Updates required ibmcclient version for ibmc drivers to 0.2.2.