From 1a3048ef0d26b15252deb5dba02994ddd1b65a42 Mon Sep 17 00:00:00 2001 From: peter_wang Date: Sun, 8 Mar 2015 20:38:25 -0400 Subject: [PATCH] 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 --- cinder/tests/test_emc_vnxdirect.py | 7 +++++++ cinder/volume/drivers/emc/emc_cli_fc.py | 4 ++++ cinder/volume/drivers/emc/emc_cli_iscsi.py | 4 ++++ cinder/volume/drivers/emc/emc_vnx_cli.py | 6 +++++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/cinder/tests/test_emc_vnxdirect.py b/cinder/tests/test_emc_vnxdirect.py index a1e7b60fed2..6628ae8f5f0 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 d7fd46f7c2e..a05b3031e1c 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 fb7b1ce9803..b5f94340532 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 45b87daf1ed..0710cc2e66c 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):