]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Refactor Nexenta iSCSI driver
authorVictor Rodionov <vito.ordaz@gmail.com>
Wed, 4 Sep 2013 22:02:51 +0000 (02:02 +0400)
committerVictor Rodionov <vito.ordaz@gmail.com>
Fri, 11 Oct 2013 21:53:20 +0000 (01:53 +0400)
1) Rename volume.py to iscsi.py
2) Rename NexentaDriver to NexentaISCSIDriver

DocImpact
Change-Id: I117d881e1f5a70ea50e44c4a409e65961b85978f

cinder/tests/test_drivers_compatibility.py
cinder/tests/test_nexenta.py
cinder/volume/drivers/nexenta/iscsi.py [moved from cinder/volume/drivers/nexenta/volume.py with 98% similarity]
cinder/volume/manager.py

index d88b856d121766c0ef2a2a315ded67e585c2a4a5..59c026bc9c7c1b01ea0f420b72948a45f3b0b4c6 100644 (file)
@@ -25,7 +25,7 @@ CONF = cfg.CONF
 
 RBD_MODULE = "cinder.volume.drivers.rbd.RBDDriver"
 SHEEPDOG_MODULE = "cinder.volume.drivers.sheepdog.SheepdogDriver"
-NEXENTA_MODULE = "cinder.volume.drivers.nexenta.volume.NexentaDriver"
+NEXENTA_MODULE = "cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver"
 SAN_MODULE = "cinder.volume.drivers.san.san.SanISCSIDriver"
 SOLARIS_MODULE = "cinder.volume.drivers.san.solaris.SolarisISCSIDriver"
 LEFTHAND_MODULE = "cinder.volume.drivers.san.hp_lefthand.HpSanISCSIDriver"
index 3742b5acd61f60f4ff747220047e1a49ceb0edc2..8ecebf67d14b934a212a9f5976f84f8ec0238e1f 100644 (file)
@@ -28,12 +28,12 @@ from cinder import test
 from cinder import units
 from cinder.volume import configuration as conf
 from cinder.volume.drivers import nexenta
+from cinder.volume.drivers.nexenta import iscsi
 from cinder.volume.drivers.nexenta import jsonrpc
 from cinder.volume.drivers.nexenta import nfs
-from cinder.volume.drivers.nexenta import volume
 
 
-class TestNexentaDriver(test.TestCase):
+class TestNexentaISCSIDriver(test.TestCase):
     TEST_VOLUME_NAME = 'volume1'
     TEST_VOLUME_NAME2 = 'volume2'
     TEST_SNAPSHOT_NAME = 'snapshot1'
@@ -53,10 +53,10 @@ class TestNexentaDriver(test.TestCase):
     }
 
     def __init__(self, method):
-        super(TestNexentaDriver, self).__init__(method)
+        super(TestNexentaISCSIDriver, self).__init__(method)
 
     def setUp(self):
-        super(TestNexentaDriver, self).setUp()
+        super(TestNexentaISCSIDriver, self).setUp()
         self.configuration = mox_lib.MockObject(conf.Configuration)
         self.configuration.nexenta_host = '1.1.1.1'
         self.configuration.nexenta_user = 'admin'
@@ -75,7 +75,7 @@ class TestNexentaDriver(test.TestCase):
             setattr(self.nms_mock, mod, self.mox.CreateMockAnything())
         self.stubs.Set(jsonrpc, 'NexentaJSONProxy',
                        lambda *_, **__: self.nms_mock)
-        self.drv = volume.NexentaDriver(configuration=self.configuration)
+        self.drv = iscsi.NexentaISCSIDriver(configuration=self.configuration)
         self.drv.do_setup({})
 
     def test_setup_error(self):
similarity index 98%
rename from cinder/volume/drivers/nexenta/volume.py
rename to cinder/volume/drivers/nexenta/iscsi.py
index 0792d3f6130dd6c4cab463ac432439ce7139a532..af4ec4ab13927f575436593f49476fb8519e9813 100644 (file)
@@ -42,19 +42,20 @@ CONF.register_opts(options.NEXENTA_ISCSI_OPTIONS)
 CONF.register_opts(options.NEXENTA_VOLUME_OPTIONS)
 
 
-class NexentaDriver(driver.ISCSIDriver):  # pylint: disable=R0921
+class NexentaISCSIDriver(driver.ISCSIDriver):  # pylint: disable=R0921
     """Executes volume driver commands on Nexenta Appliance.
 
     Version history:
         1.0.0 - Initial driver version.
         1.0.1 - Fixed bug #1236626: catch "does not exist" exception of
                 lu_exists.
+        1.1.0 - Changed class name to NexentaISCSIDriver.
     """
 
-    VERSION = '1.0.1'
+    VERSION = '1.1.0'
 
     def __init__(self, *args, **kwargs):
-        super(NexentaDriver, self).__init__(*args, **kwargs)
+        super(NexentaISCSIDriver, self).__init__(*args, **kwargs)
         self.nms = None
         if self.configuration:
             self.configuration.append_config_values(
index dda762858838a1551cf11c70c92ff724a111ad53..38da689d0490600b91da760b6220caefee371485 100644 (file)
@@ -92,7 +92,9 @@ MAPPING = {
     'cinder.volume.driver.SheepdogDriver':
     'cinder.volume.drivers.sheepdog.SheepdogDriver',
     'cinder.volume.nexenta.volume.NexentaDriver':
-    'cinder.volume.drivers.nexenta.volume.NexentaDriver',
+    'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver',
+    'cinder.volume.drivers.nexenta.volume.NexentaDriver':
+    'cinder.volume.drivers.nexenta.iscsi.NexentaISCSIDriver',
     'cinder.volume.san.SanISCSIDriver':
     'cinder.volume.drivers.san.san.SanISCSIDriver',
     'cinder.volume.san.SolarisISCSIDriver':