]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Rename Huawei drivers
authorWilson Liu <liuxinguo@huawei.com>
Wed, 21 Oct 2015 12:51:59 +0000 (20:51 +0800)
committerWilson Liu <liuxinguo@huawei.com>
Thu, 24 Dec 2015 01:20:24 +0000 (09:20 +0800)
Rename Huawei18000ISCSIDriver and Huawei18000FCDriver
to HuaweiISCSIDriver and HuaweiFCDriver.

DocImpact
Implements: blueprint huawei-driver-rename
Change-Id: I21f5a2d5bbf9a0af9e9b01878c271e9329f44cff

cinder/tests/unit/test_huawei_drivers.py
cinder/tests/unit/test_huawei_drivers_compatibility.py
cinder/volume/drivers/huawei/huawei_driver.py
cinder/volume/manager.py
releasenotes/notes/rename-huawei-driver-092025e46b65cd48.yaml [new file with mode: 0644]

index 886fff92d8180410436e809fb6d0c9a5326b7bf6..8f6f8e69214e1d48e2bc445378230ecdb2efae0f 100644 (file)
@@ -12,7 +12,7 @@
 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 #    License for the specific language governing permissions and limitations
 #    under the License.
-"""Tests for huawei 18000 storage."""
+"""Tests for huawei drivers."""
 import json
 import mock
 import os
@@ -121,7 +121,7 @@ test_host = {'host': 'ubuntu001@backend001#OpenStack_Pool',
                               'timestamp': '2015-07-13T11:41:00.513549',
                               'smartpartition': True,
                               'allocated_capacity_gb': 0,
-                              'volume_backend_name': 'Huawei18000FCDriver',
+                              'volume_backend_name': 'HuaweiFCDriver',
                               'free_capacity_gb': 20.0,
                               'driver_version': '1.1.0',
                               'total_capacity_gb': 20.0,
@@ -1395,7 +1395,7 @@ def Fake_sleep(time):
     pass
 
 
-class Fake18000Client(rest_client.RestClient):
+class FakeClient(rest_client.RestClient):
 
     def __init__(self, configuration):
         rest_client.RestClient.__init__(self, configuration)
@@ -1476,7 +1476,7 @@ class Fake18000Client(rest_client.RestClient):
         return json.loads(data)
 
 
-class Fake18000ISCSIStorage(huawei_driver.Huawei18000ISCSIDriver):
+class FakeISCSIStorage(huawei_driver.HuaweiISCSIDriver):
     """Fake Huawei Storage, Rewrite some methods of HuaweiISCSIDriver."""
 
     def __init__(self, configuration):
@@ -1484,10 +1484,10 @@ class Fake18000ISCSIStorage(huawei_driver.Huawei18000ISCSIDriver):
         self.xml_file_path = self.configuration.cinder_huawei_conf_file
 
     def do_setup(self):
-        self.restclient = Fake18000Client(configuration=self.configuration)
+        self.restclient = FakeClient(configuration=self.configuration)
 
 
-class Fake18000FCStorage(huawei_driver.Huawei18000FCDriver):
+class FakeFCStorage(huawei_driver.HuaweiFCDriver):
     """Fake Huawei Storage, Rewrite some methods of HuaweiISCSIDriver."""
 
     def __init__(self, configuration):
@@ -1496,13 +1496,13 @@ class Fake18000FCStorage(huawei_driver.Huawei18000FCDriver):
         self.fcsan_lookup_service = None
 
     def do_setup(self):
-        self.restclient = Fake18000Client(configuration=self.configuration)
+        self.restclient = FakeClient(configuration=self.configuration)
 
 
-class Huawei18000ISCSIDriverTestCase(test.TestCase):
+class HuaweiISCSIDriverTestCase(test.TestCase):
 
     def setUp(self):
-        super(Huawei18000ISCSIDriverTestCase, self).setUp()
+        super(HuaweiISCSIDriverTestCase, self).setUp()
         self.tmp_dir = tempfile.mkdtemp()
         self.fake_conf_file = self.tmp_dir + '/cinder_huawei_conf.xml'
         self.addCleanup(shutil.rmtree, self.tmp_dir)
@@ -1513,7 +1513,7 @@ class Huawei18000ISCSIDriverTestCase(test.TestCase):
         self.xml_file_path = self.configuration.cinder_huawei_conf_file
         self.configuration.hypermetro_devices = hypermetro_devices
         self.stubs.Set(time, 'sleep', Fake_sleep)
-        driver = Fake18000ISCSIStorage(configuration=self.configuration)
+        driver = FakeISCSIStorage(configuration=self.configuration)
         self.driver = driver
         self.driver.do_setup()
         self.portgroup = 'portgroup-test'
@@ -1610,7 +1610,7 @@ class Huawei18000ISCSIDriverTestCase(test.TestCase):
     def test_get_volume_status(self):
         self.driver.restclient.login()
         data = self.driver.get_volume_stats()
-        self.assertEqual('1.1.1', data['driver_version'])
+        self.assertEqual('2.0.0', data['driver_version'])
 
     def test_extend_volume(self):
         self.driver.restclient.login()
@@ -2082,10 +2082,10 @@ class FCSanLookupService(object):
         return fake_fabric_mapping
 
 
-class Huawei18000FCDriverTestCase(test.TestCase):
+class HuaweiFCDriverTestCase(test.TestCase):
 
     def setUp(self):
-        super(Huawei18000FCDriverTestCase, self).setUp()
+        super(HuaweiFCDriverTestCase, self).setUp()
         self.tmp_dir = tempfile.mkdtemp()
         self.fake_conf_file = self.tmp_dir + '/cinder_huawei_conf.xml'
         self.addCleanup(shutil.rmtree, self.tmp_dir)
@@ -2096,7 +2096,7 @@ class Huawei18000FCDriverTestCase(test.TestCase):
         self.xml_file_path = self.configuration.cinder_huawei_conf_file
         self.configuration.hypermetro_devices = hypermetro_devices
         self.stubs.Set(time, 'sleep', Fake_sleep)
-        driver = Fake18000FCStorage(configuration=self.configuration)
+        driver = FakeFCStorage(configuration=self.configuration)
         self.driver = driver
         self.driver.do_setup()
 
@@ -2153,7 +2153,7 @@ class Huawei18000FCDriverTestCase(test.TestCase):
     def test_get_volume_status(self):
         self.driver.restclient.login()
         data = self.driver.get_volume_stats()
-        self.assertEqual('1.1.1', data['driver_version'])
+        self.assertEqual('2.0.0', data['driver_version'])
 
     def test_extend_volume(self):
         self.driver.restclient.login()
@@ -2310,7 +2310,7 @@ class Huawei18000FCDriverTestCase(test.TestCase):
                          'capabilities':
                              {'location_info': '210235G7J20000000000',
                               'allocated_capacity_gb': 0,
-                              'volume_backend_name': 'Huawei18000FCDriver',
+                              'volume_backend_name': 'HuaweiFCDriver',
                               'storage_protocol': 'FC'}}
         is_valid = self.driver._check_migration_valid(invalid_host1,
                                                       test_volume)
@@ -2321,7 +2321,7 @@ class Huawei18000FCDriverTestCase(test.TestCase):
                              {'location_info': '210235G7J20000000001',
                               'allocated_capacity_gb': 0,
                               'pool_name': 'OpenStack_Pool',
-                              'volume_backend_name': 'Huawei18000FCDriver',
+                              'volume_backend_name': 'HuaweiFCDriver',
                               'storage_protocol': 'FC'}}
         is_valid = self.driver._check_migration_valid(invalid_host2,
                                                       test_volume)
@@ -2340,7 +2340,7 @@ class Huawei18000FCDriverTestCase(test.TestCase):
                              {'location_info': '210235G7J20000000001',
                               'allocated_capacity_gb': 0,
                               'pool_name': 'OpenStack_Pool',
-                              'volume_backend_name': 'Huawei18000FCDriver',
+                              'volume_backend_name': 'HuaweiFCDriver',
                               'storage_protocol': 'iSCSI'}}
         is_valid = self.driver._check_migration_valid(invalid_host2,
                                                       volume_in_use)
@@ -2351,7 +2351,7 @@ class Huawei18000FCDriverTestCase(test.TestCase):
                              {'location_info': '210235G7J20000000001',
                               'allocated_capacity_gb': 0,
                               'pool_name': '',
-                              'volume_backend_name': 'Huawei18000FCDriver',
+                              'volume_backend_name': 'HuaweiFCDriver',
                               'storage_protocol': 'iSCSI'}}
         is_valid = self.driver._check_migration_valid(invalid_host3,
                                                       test_volume)
index 3577a3d8b69f6f2d9cba633e909001063666b005..1535ae4b87b201421c987ea335e56929d57341b7 100644 (file)
@@ -22,9 +22,9 @@ from cinder import test
 
 CONF = cfg.CONF
 HUAWEI_ISCSI_MODULE = ("cinder.volume.drivers.huawei.huawei_driver."
-                       "Huawei18000ISCSIDriver")
+                       "HuaweiISCSIDriver")
 HUAWEI_FC_MODULE = ("cinder.volume.drivers.huawei.huawei_driver."
-                    "Huawei18000FCDriver")
+                    "HuaweiFCDriver")
 
 
 class VolumeDriverCompatibility(test.TestCase):
@@ -47,7 +47,8 @@ class VolumeDriverCompatibility(test.TestCase):
 
     def test_huawei_driver_iscsi_old(self):
         self._load_driver(
-            'cinder.volume.drivers.huawei.huawei_18000.Huawei18000ISCSIDriver')
+            'cinder.volume.drivers.huawei.huawei_driver.'
+            'Huawei18000ISCSIDriver')
         self.assertEqual(self._driver_module_name(), HUAWEI_ISCSI_MODULE)
 
     def test_huawei_driver_iscsi_new(self):
@@ -56,7 +57,7 @@ class VolumeDriverCompatibility(test.TestCase):
 
     def test_huawei_driver_fc_old(self):
         self._load_driver(
-            'cinder.volume.drivers.huawei.huawei_18000.Huawei18000FCDriver')
+            'cinder.volume.drivers.huawei.huawei_driver.Huawei18000FCDriver')
         self.assertEqual(self._driver_module_name(), HUAWEI_FC_MODULE)
 
     def test_huawei_driver_fc_new(self):
index 3e1a1a2e54dd3627c31b9d4d6772a45d42cd7f9e..9c230abe4e30ef63a851239428d40f82d0627c56 100644 (file)
@@ -227,7 +227,7 @@ class HuaweiBaseDriver(driver.VolumeDriver):
                     if constants.MIGRATION_COMPLETE == item['RUNNINGSTATUS']:
                         return True
                     if constants.MIGRATION_FAULT == item['RUNNINGSTATUS']:
-                        err_msg = _('Lun migration error.')
+                        err_msg = _("Lun migration error.")
                         LOG.error(err_msg)
                         raise exception.VolumeBackendAPIException(data=err_msg)
         if not found_migration_task:
@@ -840,8 +840,8 @@ class HuaweiBaseDriver(driver.VolumeDriver):
         self.restclient.delete_luncopy(luncopy_id)
 
 
-class Huawei18000ISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
-    """ISCSI driver for Huawei OceanStor 18000 storage arrays.
+class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
+    """ISCSI driver for Huawei storage arrays.
 
     Version history:
         1.0.0 - Initial driver
@@ -853,12 +853,13 @@ class Huawei18000ISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
                 SmartX support
                 Volume migration support
                 Volume retype support
+        2.0.0 - Rename to HuaweiISCSIDriver
     """
 
-    VERSION = "1.1.1"
+    VERSION = "2.0.0"
 
     def __init__(self, *args, **kwargs):
-        super(Huawei18000ISCSIDriver, self).__init__(*args, **kwargs)
+        super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
 
     def get_volume_stats(self, refresh=False):
         """Get volume status."""
@@ -1037,8 +1038,8 @@ class Huawei18000ISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
             self.restclient.delete_mapping_view(view_id)
 
 
-class Huawei18000FCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
-    """FC driver for Huawei OceanStor 18000 storage arrays.
+class HuaweiFCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
+    """FC driver for Huawei storage arrays.
 
     Version history:
         1.0.0 - Initial driver
@@ -1050,12 +1051,13 @@ class Huawei18000FCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
                 Volume retype support
                 FC zone enhancement
                 Volume hypermetro support
+        2.0.0 - Rename to HuaweiFCDriver
     """
 
-    VERSION = "1.1.1"
+    VERSION = "2.0.0"
 
     def __init__(self, *args, **kwargs):
-        super(Huawei18000FCDriver, self).__init__(*args, **kwargs)
+        super(HuaweiFCDriver, self).__init__(*args, **kwargs)
         self.fcsan_lookup_service = None
 
     def get_volume_stats(self, refresh=False):
index 783eb58ffe6ea23df772010c31eb405fa37d7747..4026df9b1f365e9170f145fe83b8216cd1ced4f7 100644 (file)
@@ -113,9 +113,13 @@ CONF.register_opts(volume_manager_opts)
 
 MAPPING = {
     'cinder.volume.drivers.huawei.huawei_18000.Huawei18000ISCSIDriver':
-    'cinder.volume.drivers.huawei.huawei_driver.Huawei18000ISCSIDriver',
+    'cinder.volume.drivers.huawei.huawei_driver.HuaweiISCSIDriver',
+    'cinder.volume.drivers.huawei.huawei_driver.Huawei18000ISCSIDriver':
+    'cinder.volume.drivers.huawei.huawei_driver.HuaweiISCSIDriver',
     'cinder.volume.drivers.huawei.huawei_18000.Huawei18000FCDriver':
-    'cinder.volume.drivers.huawei.huawei_driver.Huawei18000FCDriver',
+    'cinder.volume.drivers.huawei.huawei_driver.HuaweiFCDriver',
+    'cinder.volume.drivers.huawei.huawei_driver.Huawei18000FCDriver':
+    'cinder.volume.drivers.huawei.huawei_driver.HuaweiFCDriver',
     'cinder.volume.drivers.fujitsu_eternus_dx_fc.FJDXFCDriver':
     'cinder.volume.drivers.fujitsu.eternus_dx_fc.FJDXFCDriver',
     'cinder.volume.drivers.fujitsu_eternus_dx_iscsi.FJDXISCSIDriver':
diff --git a/releasenotes/notes/rename-huawei-driver-092025e46b65cd48.yaml b/releasenotes/notes/rename-huawei-driver-092025e46b65cd48.yaml
new file mode 100644 (file)
index 0000000..12db6bb
--- /dev/null
@@ -0,0 +1,2 @@
+upgrade:
+  - Rename Huawei18000ISCSIDriver and Huawei18000FCDriver to HuaweiISCSIDriver and HuaweiFCDriver.