From 78af5f869ee9421b2fed2c7cdfbf4b3957840f75 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) (cherry picked from commit c5f4e6aff5b591099dab1f5350b9c6c6494cfccb) (cherry picked from commit 25a43b48724477dca44513de153e5a7d50f8ed23) --- .../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 8fc03b52807..76765a2c87b 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 @@ -65,7 +65,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() @property @@ -564,7 +564,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')