From c5f4e6aff5b591099dab1f5350b9c6c6494cfccb Mon Sep 17 00:00:00 2001 From: Yong Huang Date: Mon, 16 Mar 2020 01:20:52 -0400 Subject: [PATCH] [Unity] Fix TypeError for test case test_delete_host_wo_lock Fix TypeError "'NoneType' object is not callable" in test case test_delete_host_wo_lock Change-Id: I44650912e88808ce56b347633093e05d5741252c Closes-bug: #1867619 (cherry picked from commit f88845d756ebd50713a6533d0e3108c4ff9ce00d) --- .../tests/unit/volume/drivers/dell_emc/unity/test_client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cinder/tests/unit/volume/drivers/dell_emc/unity/test_client.py b/cinder/tests/unit/volume/drivers/dell_emc/unity/test_client.py index a4c593d5ce8..4953126eda4 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/unity/test_client.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/unity/test_client.py @@ -70,7 +70,7 @@ class MockResource(object): raise ex.UnityResourceNotFoundError() elif self.get_id() == 'snap_in_use': raise ex.UnityDeleteAttachedSnapError() - elif self.name == 'empty_host': + elif self.name == 'empty-host': raise ex.HostDeleteIsCalled() elif self.get_id() == 'lun_in_replication': if not force_snap_delete: @@ -649,7 +649,8 @@ class ClientTest(unittest.TestCase): host = MockResource(name='empty-host') self.client.host_cache['empty-host'] = host self.assertRaises(ex.HostDeleteIsCalled, - self.client.delete_host_wo_lock(host)) + self.client.delete_host_wo_lock, + host) def test_delete_host_wo_lock_remove_from_cache(self): host = MockResource(name='empty-host-in-cache')