diff --git a/cinder/tests/unit/volume/drivers/dell_emc/vnx/mocked_vnx.yaml b/cinder/tests/unit/volume/drivers/dell_emc/vnx/mocked_vnx.yaml index 68483d9cf8d..4629df389a0 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/vnx/mocked_vnx.yaml +++ b/cinder/tests/unit/volume/drivers/dell_emc/vnx/mocked_vnx.yaml @@ -2082,7 +2082,7 @@ test_terminate_connection_cleanup_deregister: get_alu_hlu_map: {} vnx: _methods: - remove_hba: + delete_hba: test_terminate_connection_cleanup_sg_is_not_empty: sg: diff --git a/cinder/tests/unit/volume/drivers/dell_emc/vnx/test_adapter.py b/cinder/tests/unit/volume/drivers/dell_emc/vnx/test_adapter.py index beaee2292af..451aa34d9a1 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/vnx/test_adapter.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/vnx/test_adapter.py @@ -1001,9 +1001,9 @@ class TestCommonAdapter(test.TestCase): host = common.Host('fake_host', ['fake_initiator1', 'fake_initiator2']) sg = mocked_res['sg'] common_adapter.terminate_connection_cleanup(host, sg) - common_adapter.client.vnx.remove_hba.assert_any_call( + common_adapter.client.vnx.delete_hba.assert_any_call( 'fake_initiator1') - common_adapter.client.vnx.remove_hba.assert_any_call( + common_adapter.client.vnx.delete_hba.assert_any_call( 'fake_initiator2') @res_mock.patch_common_adapter diff --git a/cinder/volume/drivers/dell_emc/vnx/client.py b/cinder/volume/drivers/dell_emc/vnx/client.py index fd7ae283a26..46e3f1ebcbf 100644 --- a/cinder/volume/drivers/dell_emc/vnx/client.py +++ b/cinder/volume/drivers/dell_emc/vnx/client.py @@ -539,7 +539,10 @@ class Client(object): if not isinstance(initiators, list): initiators = [initiators] for initiator_uid in initiators: - self.vnx.remove_hba(initiator_uid) + try: + self.vnx.delete_hba(initiator_uid) + except AttributeError: + self.vnx.remove_hba(initiator_uid) def update_consistencygroup(self, cg, lun_ids_to_add, lun_ids_to_remove): lun_ids_in_cg = (set([l.lun_id for l in cg.lun_list]) if cg.lun_list