]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Raise NotImplemented for drivers that don't support images
authorSam Morrison <sorrison@gmail.com>
Fri, 14 Dec 2012 02:49:46 +0000 (13:49 +1100)
committerSam Morrison <sorrison@gmail.com>
Fri, 14 Dec 2012 03:01:59 +0000 (14:01 +1100)
Fixes bug #1090169

Raise NotImplementedError on copy_image_to_volume and
copy_volume_to_image on drivers that inherit from
driver.ISCSIDriver that don't support this feature yet.

Change-Id: I516d424a75dd21260f2ccc68467a8f6e6ac08e4d

cinder/volume/drivers/netapp.py
cinder/volume/drivers/nexenta/volume.py
cinder/volume/drivers/san/san.py
cinder/volume/drivers/windows.py
cinder/volume/drivers/zadara.py

index a6220ed88738e5f417fbc7664cc49d1fa08d641c..387b2019cf3111250660dbfc864c2433770f0d02 100644 (file)
@@ -1296,3 +1296,11 @@ class NetAppCmodeISCSIDriver(driver.ISCSIDriver):
         for meta in metadata:
             meta_dict[meta.Key] = meta.Value
         return meta_dict
+
+    def copy_image_to_volume(self, context, volume, image_service, image_id):
+        """Fetch the image from image_service and write it to the volume."""
+        raise NotImplementedError()
+
+    def copy_volume_to_image(self, context, volume, image_service, image_id):
+        """Copy the volume to the specified image."""
+        raise NotImplementedError()
index 21d9cec41cd4a56ced8512c697310e995e0a7e77..6769f301ae2073e92f9fd2b45e3fa56b2fa5df77 100644 (file)
@@ -279,3 +279,11 @@ class NexentaDriver(driver.ISCSIDriver):  # pylint: disable=R0921
             LOG.warn(_('Got error trying to delete target %(target)s,'
                        ' assuming it is already gone: %(exc)s'),
                      {'target': target_name, 'exc': exc})
+
+    def copy_image_to_volume(self, context, volume, image_service, image_id):
+        """Fetch the image from image_service and write it to the volume."""
+        raise NotImplementedError()
+
+    def copy_volume_to_image(self, context, volume, image_service, image_id):
+        """Copy the volume to the specified image."""
+        raise NotImplementedError()
index a2a98c7585d4f6efaad000b08538aceed047a517..57299d8c95eaf7efd5586936466690cb3788681d 100644 (file)
@@ -153,3 +153,11 @@ class SanISCSIDriver(ISCSIDriver):
         # The san_ip must always be set, because we use it for the target
         if not FLAGS.san_ip:
             raise exception.InvalidInput(reason=_("san_ip must be set"))
+
+    def copy_image_to_volume(self, context, volume, image_service, image_id):
+        """Fetch the image from image_service and write it to the volume."""
+        raise NotImplementedError()
+
+    def copy_volume_to_image(self, context, volume, image_service, image_id):
+        """Copy the volume to the specified image."""
+        raise NotImplementedError()
index 037737440fccdfd2c555597ce3a234111dd751df..6990475c54d0642903276e178f3de55790e84b4e 100644 (file)
@@ -230,3 +230,11 @@ class WindowsDriver(driver.ISCSIDriver):
         wt_host = self._conn_wmi.WT_Host(HostName=target_name)[0]
         wt_host.RemoveAllWTDisks()
         wt_host.Delete_()
+
+    def copy_image_to_volume(self, context, volume, image_service, image_id):
+        """Fetch the image from image_service and write it to the volume."""
+        raise NotImplementedError()
+
+    def copy_volume_to_image(self, context, volume, image_service, image_id):
+        """Copy the volume to the specified image."""
+        raise NotImplementedError()
index f4ec814b9f8d77ef7940f66a0e285a171db60af1..dee160742b7aa73bf890743772d89ce1889d9417 100644 (file)
@@ -478,3 +478,11 @@ class ZadaraVPSAISCSIDriver(driver.ISCSIDriver):
 
     def delete_snapshot(self, snapshot):
         raise NotImplementedError()
+
+    def copy_image_to_volume(self, context, volume, image_service, image_id):
+        """Fetch the image from image_service and write it to the volume."""
+        raise NotImplementedError()
+
+    def copy_volume_to_image(self, context, volume, image_service, image_id):
+        """Copy the volume to the specified image."""
+        raise NotImplementedError()