]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Move CloneableVD to common functions
authorMarc Koderer <marc@koderer.com>
Mon, 20 Jul 2015 11:26:49 +0000 (13:26 +0200)
committerJohn Griffith <john.griffith8@gmail.com>
Tue, 13 Oct 2015 18:26:20 +0000 (18:26 +0000)
Since every driver implements the functions needed by CloneableVD
we can move it to BaseVD.

Change-Id: I3ce24f9950bfa54c8dc19835f0e19f4c3c5181c8

20 files changed:
cinder/volume/driver.py
cinder/volume/drivers/block_device.py
cinder/volume/drivers/dell/dell_storagecenter_common.py
cinder/volume/drivers/glusterfs.py
cinder/volume/drivers/ibm/gpfs.py
cinder/volume/drivers/ibm/storwize_svc/__init__.py
cinder/volume/drivers/ibm/xiv_ds8k.py
cinder/volume/drivers/netapp/dataontap/fc_7mode.py
cinder/volume/drivers/netapp/dataontap/fc_cmode.py
cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py
cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py
cinder/volume/drivers/netapp/dataontap/nfs_base.py
cinder/volume/drivers/netapp/eseries/fc_driver.py
cinder/volume/drivers/netapp/eseries/iscsi_driver.py
cinder/volume/drivers/prophetstor/dplcommon.py
cinder/volume/drivers/rbd.py
cinder/volume/drivers/san/hp/hp_3par_fc.py
cinder/volume/drivers/san/hp/hp_3par_iscsi.py
cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py
cinder/volume/drivers/tintri.py

index 2eba2cca3014924a41c3630b57e51d4e5126a898..d4b510e7dcf3a8ff133be56c7bd5ef0b31e7ae81 100644 (file)
@@ -1328,6 +1328,16 @@ class BaseVD(object):
     def retype(self, context, volume, new_type, diff, host):
         return False, None
 
+    def create_cloned_volume(self, volume, src_vref):
+        """Creates a clone of the specified volume.
+
+        If volume_type extra specs includes 'replication: <is> True' the
+        driver needs to create a volume replica (secondary)
+        and setup replication between the newly created volume
+        and the secondary volume.
+        """
+        raise NotImplementedError()
+
     # #######  Interface methods for DataPath (Connector) ########
     @abc.abstractmethod
     def ensure_export(self, context, volume):
@@ -1506,21 +1516,6 @@ class ConsistencyGroupVD(object):
         return
 
 
-@six.add_metaclass(abc.ABCMeta)
-class CloneableVD(object):
-    @abc.abstractmethod
-    def create_cloned_volume(self, volume, src_vref):
-        """Creates a clone of the specified volume.
-
-        If volume_type extra specs includes 'replication: <is> True' the
-        driver needs to create a volume replica (secondary)
-        and setup replication between the newly created volume
-        and the secondary volume.
-        """
-
-        return
-
-
 @six.add_metaclass(abc.ABCMeta)
 class CloneableImageVD(object):
     @abc.abstractmethod
@@ -1966,7 +1961,7 @@ class ReplicaVD(object):
 
 
 class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD,
-                   CloneableVD, CloneableImageVD, ManageableSnapshotsVD,
+                   CloneableImageVD, ManageableSnapshotsVD,
                    SnapshotVD, ReplicaVD, LocalVD, MigrateVD, BaseVD):
     """This class will be deprecated soon.
 
@@ -1981,9 +1976,6 @@ class VolumeDriver(ConsistencyGroupVD, TransferVD, ManageableVD, ExtendVD,
     def create_volume_from_snapshot(self, volume, snapshot):
         raise NotImplementedError()
 
-    def create_cloned_volume(self, volume, src_vref):
-        raise NotImplementedError()
-
     def create_replica_test_volume(self, volume, src_vref):
         raise NotImplementedError()
 
index 0085496c67eeeb8a47037fa1aa0eead16e248d5d..6a54e657b6f40a08e588de9cd6c98ea4910e73c2 100644 (file)
@@ -41,7 +41,7 @@ CONF = cfg.CONF
 CONF.register_opts(volume_opts)
 
 
-class BlockDeviceDriver(driver.BaseVD, driver.LocalVD, driver.CloneableVD,
+class BlockDeviceDriver(driver.BaseVD, driver.LocalVD,
                         driver.CloneableImageVD, driver.TransferVD):
     VERSION = '2.1.0'
 
index c937ff5d2be08db8670b8a4f75b126f35c461811..46299d3470bfdd45e62b7db34173a4dfb5582cd6 100644 (file)
@@ -51,8 +51,7 @@ CONF.register_opts(common_opts)
 
 
 class DellCommonDriver(driver.ConsistencyGroupVD, driver.ManageableVD,
-                       driver.ExtendVD, driver.CloneableVD, driver.SnapshotVD,
-                       driver.BaseVD):
+                       driver.ExtendVD, driver.SnapshotVD, driver.BaseVD):
 
     def __init__(self, *args, **kwargs):
         super(DellCommonDriver, self).__init__(*args, **kwargs)
index dca3be61580a504be2454c658385ba04cf24f5af..917028dddb6ef476ac0398f7bc9c1a52a557cc34 100644 (file)
@@ -48,7 +48,7 @@ CONF = cfg.CONF
 CONF.register_opts(volume_opts)
 
 
-class GlusterfsDriver(remotefs_drv.RemoteFSSnapDriver, driver.CloneableVD,
+class GlusterfsDriver(remotefs_drv.RemoteFSSnapDriver,
                       driver.ExtendVD):
     """Gluster based cinder driver.
 
index 2c0884707f2d0eb5091454cbd0e298c22d5198d5..0b30f28a0e33df7db32e0c55b0ed5d1d80d10418 100644 (file)
@@ -108,7 +108,7 @@ def _sizestr(size_in_g):
 
 
 class GPFSDriver(driver.ConsistencyGroupVD, driver.ExtendVD,
-                 driver.LocalVD, driver.TransferVD, driver.CloneableVD,
+                 driver.LocalVD, driver.TransferVD,
                  driver.CloneableImageVD, driver.SnapshotVD,
                  driver.MigrateVD,
                  driver.BaseVD):
index e33c62aef129d8f4305359c80ee2a87d61f5252a..14fc48952d20b9e51cef9383161adbf25afb1918 100644 (file)
@@ -139,8 +139,7 @@ class StorwizeSVCDriver(san.SanDriver,
                         driver.ExtendVD, driver.SnapshotVD,
                         driver.MigrateVD, driver.ReplicaVD,
                         driver.ConsistencyGroupVD,
-                        driver.CloneableVD, driver.CloneableImageVD,
-                        driver.TransferVD):
+                        driver.CloneableImageVD, driver.TransferVD):
     """IBM Storwize V7000 and SVC iSCSI/FC volume driver.
 
     Version history:
index 93caceaa4a45920985c10554bcfe3e23c06c5cf6..31de5586922abec8cb06dd400d7bf9686aa8596c 100644 (file)
@@ -65,7 +65,6 @@ class XIVDS8KDriver(san.SanDriver,
                     driver.MigrateVD,
                     driver.ReplicaVD,
                     driver.ConsistencyGroupVD,
-                    driver.CloneableVD,
                     driver.CloneableImageVD,
                     driver.TransferVD):
     """Unified IBM XIV and DS8K volume driver."""
index 1d87dadf755a6d6f01a9d707ce3da23525ff7fd5..2646eef4acf38ec6a525e8c813d12ce709149531 100644 (file)
@@ -28,7 +28,6 @@ LOG = logging.getLogger(__name__)
 class NetApp7modeFibreChannelDriver(driver.BaseVD,
                                     driver.ManageableVD,
                                     driver.ExtendVD,
-                                    driver.CloneableVD,
                                     driver.TransferVD,
                                     driver.SnapshotVD):
     """NetApp 7-mode FibreChannel volume driver."""
index fda10b8c158ba3d1da9165e36f69d7c693f2fecb..7c6e83ab7038d214651b91928582489d40269015 100644 (file)
@@ -28,7 +28,6 @@ LOG = logging.getLogger(__name__)
 class NetAppCmodeFibreChannelDriver(driver.BaseVD,
                                     driver.ManageableVD,
                                     driver.ExtendVD,
-                                    driver.CloneableVD,
                                     driver.TransferVD,
                                     driver.SnapshotVD):
     """NetApp C-mode FibreChannel volume driver."""
index 103e293b1538139b71453f1511010da7b861c83d..bf47ea1a17c498cfe8dbff7b84d09994a25cd6b4 100644 (file)
@@ -27,7 +27,6 @@ LOG = logging.getLogger(__name__)
 class NetApp7modeISCSIDriver(driver.BaseVD,
                              driver.ManageableVD,
                              driver.ExtendVD,
-                             driver.CloneableVD,
                              driver.TransferVD,
                              driver.SnapshotVD):
     """NetApp 7-mode iSCSI volume driver."""
index f502ae65146209102fa96b127a28621467713592..53036b952d72ccd9b04ac8f3bda0609458061c07 100644 (file)
@@ -27,7 +27,6 @@ LOG = logging.getLogger(__name__)
 class NetAppCmodeISCSIDriver(driver.BaseVD,
                              driver.ManageableVD,
                              driver.ExtendVD,
-                             driver.CloneableVD,
                              driver.TransferVD,
                              driver.SnapshotVD):
     """NetApp C-mode iSCSI volume driver."""
index 976fece7cf8cf2fa98e63e1055a4719ae2aabae1..4f758dbfcaa65a51456f0c69f9a8c9c34ce4aca5 100644 (file)
@@ -52,7 +52,6 @@ CONF = cfg.CONF
 
 @six.add_metaclass(utils.TraceWrapperWithABCMetaclass)
 class NetAppNfsDriver(driver.ManageableVD,
-                      driver.CloneableVD,
                       driver.CloneableImageVD,
                       driver.SnapshotVD,
                       nfs.NfsDriver):
index 3930afc1906309ed06f6cc250404299471382706..70b89e995b802d4de30d5419d2a0fda31dc22144 100644 (file)
@@ -29,7 +29,6 @@ LOG = logging.getLogger(__name__)
 class NetAppEseriesFibreChannelDriver(driver.BaseVD,
                                       driver.ManageableVD,
                                       driver.ExtendVD,
-                                      driver.CloneableVD,
                                       driver.TransferVD,
                                       driver.SnapshotVD):
     """NetApp E-Series FibreChannel volume driver."""
index df96bb1e25b9d7eb2844205aefca71ba85628020..94beff0fa7e947362c38fb15a1529f90d26e4aab 100644 (file)
@@ -31,7 +31,6 @@ LOG = logging.getLogger(__name__)
 class NetAppEseriesISCSIDriver(driver.BaseVD,
                                driver.ManageableVD,
                                driver.ExtendVD,
-                               driver.CloneableVD,
                                driver.TransferVD,
                                driver.SnapshotVD):
     """NetApp E-Series iSCSI volume driver."""
index 0ce4bf0282a926325ae28028899cc4049cc28dbe..18109769e670907ea53701c6411abee6f62315e7 100644 (file)
@@ -697,7 +697,7 @@ class DPLVolume(object):
 
 
 class DPLCOMMONDriver(driver.ConsistencyGroupVD, driver.ExtendVD,
-                      driver.CloneableVD, driver.CloneableImageVD,
+                      driver.CloneableImageVD,
                       driver.SnapshotVD, driver.LocalVD, driver.BaseVD):
     """Class of dpl storage adapter."""
     VERSION = '2.0.4'
index b3be6e1cba84c1ca0ef07b0df4a3c887e3419d15..637e8eec4475738a3731d659e6817b8c4498cd6a 100644 (file)
@@ -265,7 +265,7 @@ class RADOSClient(object):
 
 
 class RBDDriver(driver.TransferVD, driver.ExtendVD,
-                driver.CloneableVD, driver.CloneableImageVD, driver.SnapshotVD,
+                driver.CloneableImageVD, driver.SnapshotVD,
                 driver.MigrateVD, driver.BaseVD):
     """Implements RADOS block device (RBD) volume commands."""
 
index e4278ba5837287663bde8226e814fb7fea4fbc6e..40d55c61ccecbc377b39854b2b18d66083d77c99 100644 (file)
@@ -49,7 +49,6 @@ LOG = logging.getLogger(__name__)
 class HP3PARFCDriver(driver.TransferVD,
                      driver.ManageableVD,
                      driver.ExtendVD,
-                     driver.CloneableVD,
                      driver.SnapshotVD,
                      driver.MigrateVD,
                      driver.ConsistencyGroupVD,
index cc5a4a4feb13367e30f424cc3b2555c232770fd4..f4fc7ecfc93915cf2c85f168a45b8029d13dcda5 100644 (file)
@@ -54,7 +54,6 @@ CHAP_PASS_KEY = "HPQ-cinder-CHAP-secret"
 class HP3PARISCSIDriver(driver.TransferVD,
                         driver.ManageableVD,
                         driver.ExtendVD,
-                        driver.CloneableVD,
                         driver.SnapshotVD,
                         driver.MigrateVD,
                         driver.ConsistencyGroupVD,
index 21bcc3aa5c8343b5b73d44778fca9eed0c26dd68..09c929755044ac40ce40180940435cac9059ab4c 100644 (file)
@@ -48,7 +48,6 @@ MIN_CLIENT_VERSION = '1.0.4'
 class HPLeftHandISCSIDriver(driver.TransferVD,
                             driver.ManageableVD,
                             driver.ExtendVD,
-                            driver.CloneableVD,
                             driver.SnapshotVD,
                             driver.MigrateVD,
                             driver.BaseVD,
index 2254c2c87e507022446334131288ef1fb2eedc17..c5c250a750cd9e5fb3dd95a824cfc32fe2497365 100644 (file)
@@ -62,7 +62,6 @@ CONF.register_opts(tintri_opts)
 
 
 class TintriDriver(driver.ManageableVD,
-                   driver.CloneableVD,
                    driver.CloneableImageVD,
                    driver.SnapshotVD,
                    nfs.NfsDriver):