From: peter_wang Date: Mon, 9 Mar 2015 00:38:25 +0000 (-0400) Subject: Fixes VNX NotImplementedError of unmanage X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=1a3048ef0d26b15252deb5dba02994ddd1b65a42;p=openstack-build%2Fcinder-build.git Fixes VNX NotImplementedError of unmanage When unmanaging a volume, cinder would call unmanage. This fix is to add unmanage to avoid NotImplementedError. Change-Id: I11539cc945d432e23bebf085cacb0023b9a6a1e3 Closes-Bug: 1429702 --- diff --git a/cinder/tests/test_emc_vnxdirect.py b/cinder/tests/test_emc_vnxdirect.py index a1e7b60fe..6628ae8f5 100644 --- a/cinder/tests/test_emc_vnxdirect.py +++ b/cinder/tests/test_emc_vnxdirect.py @@ -3064,6 +3064,13 @@ Time Remaining: 0 second(s) '-o')] fake_cli.assert_has_calls(expect_cmd) + def test_unmanage(self): + self.driverSetup() + try: + self.driver.unmanage(self.testData.test_volume) + except NotImplementedError: + self.fail('Interface unmanage need to be implemented') + class EMCVNXCLIDArrayBasedDriverTestCase(DriverTestCaseBase): def setUp(self): diff --git a/cinder/volume/drivers/emc/emc_cli_fc.py b/cinder/volume/drivers/emc/emc_cli_fc.py index d7fd46f7c..a05b3031e 100644 --- a/cinder/volume/drivers/emc/emc_cli_fc.py +++ b/cinder/volume/drivers/emc/emc_cli_fc.py @@ -247,3 +247,7 @@ class EMCCLIFCDriver(driver.FibreChannelDriver): return self.cli.update_consistencygroup(context, group, add_volumes, remove_volumes) + + def unmanage(self, volume): + """Unmanages a volume.""" + return self.cli.unmanage(volume) diff --git a/cinder/volume/drivers/emc/emc_cli_iscsi.py b/cinder/volume/drivers/emc/emc_cli_iscsi.py index fb7b1ce98..b5f943405 100644 --- a/cinder/volume/drivers/emc/emc_cli_iscsi.py +++ b/cinder/volume/drivers/emc/emc_cli_iscsi.py @@ -226,3 +226,7 @@ class EMCCLIISCSIDriver(driver.ISCSIDriver): return self.cli.update_consistencygroup(context, group, add_volumes, remove_volumes) + + def unmanage(self, volume): + """Unmanages a volume.""" + self.cli.unmanage(volume) diff --git a/cinder/volume/drivers/emc/emc_vnx_cli.py b/cinder/volume/drivers/emc/emc_vnx_cli.py index 45b87daf1..0710cc2e6 100644 --- a/cinder/volume/drivers/emc/emc_vnx_cli.py +++ b/cinder/volume/drivers/emc/emc_vnx_cli.py @@ -1582,7 +1582,7 @@ class CommandLineHelper(object): class EMCVnxCliBase(object): """This class defines the functions to use the native CLI functionality.""" - VERSION = '05.03.00' + VERSION = '05.03.01' stats = {'driver_version': VERSION, 'storage_protocol': None, 'vendor_name': 'EMC', @@ -2917,6 +2917,10 @@ class EMCVnxCliBase(object): poll=False) return data.get(self._client.LUN_POOL.key) + def unmanage(self, volume): + """Unmanages a volume""" + pass + @decorate_all_methods(log_enter_exit) class EMCVnxCliPool(EMCVnxCliBase):