]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove driver compatibility in volume manager
authorMike Perez <thingee@gmail.com>
Mon, 1 Dec 2014 21:21:27 +0000 (13:21 -0800)
committerMike Perez <thingee@gmail.com>
Mon, 1 Dec 2014 21:42:33 +0000 (13:42 -0800)
The old driver locations were deprecated in Juno. This removes the code
for deprecating and tests.

Change-Id: I1e2a985c1b41f4837e316af0655ef7203273cd7a

cinder/tests/test_drivers_compatibility.py [deleted file]
cinder/volume/manager.py

diff --git a/cinder/tests/test_drivers_compatibility.py b/cinder/tests/test_drivers_compatibility.py
deleted file mode 100644 (file)
index 4743f3f..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#    Copyright 2012 OpenStack Foundation
-#
-#    Licensed under the Apache License, Version 2.0 (the "License"); you may
-#    not use this file except in compliance with the License. You may obtain
-#    a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-#    License for the specific language governing permissions and limitations
-#    under the License.
-
-
-from oslo.config import cfg
-from oslo.utils import importutils
-
-from cinder import context
-from cinder import test
-
-
-CONF = cfg.CONF
-
-STORWIZE_MODULE = "cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver"
-LEFTHAND_REST_MODULE = ("cinder.volume.drivers.san.hp.hp_lefthand_iscsi."
-                        "HPLeftHandISCSIDriver")
-GPFS_MODULE = "cinder.volume.drivers.ibm.gpfs.GPFSDriver"
-
-
-class VolumeDriverCompatibility(test.TestCase):
-    """Test backwards compatibility for volume drivers."""
-
-    def fake_update_cluster_status(self):
-        return
-
-    def setUp(self):
-        super(VolumeDriverCompatibility, self).setUp()
-        self.manager = importutils.import_object(CONF.volume_manager)
-        self.context = context.get_admin_context()
-
-    def _load_driver(self, driver):
-        self.manager.__init__(volume_driver=driver)
-
-    def _driver_module_name(self):
-        return "%s.%s" % (self.manager.driver.__class__.__module__,
-                          self.manager.driver.__class__.__name__)
-
-    def test_storwize_svc_old(self):
-        self._load_driver(
-            'cinder.volume.drivers.storwize_svc.StorwizeSVCDriver')
-        self.assertEqual(self._driver_module_name(), STORWIZE_MODULE)
-
-    def test_storwize_svc_old2(self):
-        self._load_driver('cinder.volume.drivers.storwize_svc.'
-                          'StorwizeSVCDriver')
-        self.assertEqual(self._driver_module_name(), STORWIZE_MODULE)
-
-    def test_storwize_svc_new(self):
-        self._load_driver(STORWIZE_MODULE)
-        self.assertEqual(self._driver_module_name(), STORWIZE_MODULE)
-
-    def test_hp_lefthand_rest_old(self):
-        self._load_driver(
-            'cinder.volume.drivers.san.hp_lefthand.HpSanISCSIDriver')
-        self.assertEqual(self._driver_module_name(), LEFTHAND_REST_MODULE)
-
-    def test_hp_lefthand_rest_new(self):
-        self._load_driver(LEFTHAND_REST_MODULE)
-        self.assertEqual(self._driver_module_name(), LEFTHAND_REST_MODULE)
-
-    def test_gpfs_old(self):
-        self._load_driver('cinder.volume.drivers.gpfs.GPFSDriver')
-        self.assertEqual(self._driver_module_name(), GPFS_MODULE)
-
-    def test_gpfs_new(self):
-        self._load_driver(GPFS_MODULE)
-        self.assertEqual(self._driver_module_name(), GPFS_MODULE)
index a564ca1cd36b5a45712653a1cb3d4f125f113d53..b930222661eaeba643b66ca4a7212a0bdba1b11c 100644 (file)
@@ -97,16 +97,6 @@ volume_manager_opts = [
 CONF = cfg.CONF
 CONF.register_opts(volume_manager_opts)
 
-MAPPING = {
-    'cinder.volume.drivers.storwize_svc.StorwizeSVCDriver':
-    'cinder.volume.drivers.ibm.storwize_svc.StorwizeSVCDriver',
-    'cinder.volume.drivers.xiv_ds8k.XIVDS8KDriver':
-    'cinder.volume.drivers.ibm.xiv_ds8k.XIVDS8KDriver',
-    'cinder.volume.drivers.san.hp_lefthand.HpSanISCSIDriver':
-    'cinder.volume.drivers.san.hp.hp_lefthand_iscsi.HPLeftHandISCSIDriver',
-    'cinder.volume.drivers.gpfs.GPFSDriver':
-    'cinder.volume.drivers.ibm.gpfs.GPFSDriver', }
-
 
 def locked_volume_operation(f):
     """Lock decorator for volume operations.
@@ -173,10 +163,6 @@ class VolumeManager(manager.SchedulerDependentManager):
             # Get from configuration, which will get the default
             # if its not using the multi backend
             volume_driver = self.configuration.volume_driver
-        if volume_driver in MAPPING:
-            LOG.warn(_LW("Driver path %s is deprecated, update your "
-                         "configuration to the new path."), volume_driver)
-            volume_driver = MAPPING[volume_driver]
 
         vol_db_empty = self._set_voldb_empty_at_startup_indicator(
             context.get_admin_context())