]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Avoid returning volume metadata in DotHill driver
authornikeshm <Nikesh.Mahalaka@dothill.com>
Thu, 20 Aug 2015 20:47:12 +0000 (02:17 +0530)
committernikeshm <Nikesh.Mahalaka@dothill.com>
Thu, 20 Aug 2015 21:01:10 +0000 (02:31 +0530)
DotHill driver returns volume metadata on create volume.
It is not needed and causing CI failures.

Change-Id: Idbe16fcff60ed0c3cfa1f4ba66ca549c6dd9a1d8
Closes-Bug: #1487165
Co-Authored-By: Lakshman <lakshminarayanat@vedams.com>
cinder/tests/unit/test_dothill.py
cinder/volume/drivers/dothill/dothill_common.py
cinder/volume/drivers/dothill/dothill_fc.py
cinder/volume/drivers/dothill/dothill_iscsi.py

index b1528793b740152884ada2cedded931bf175f39f..6b9365bb1edb707652b408506136bbd92a2beb68 100644 (file)
@@ -558,20 +558,18 @@ class TestDotHillFC(test.TestCase):
 
     @mock.patch.object(dothill_common.DotHillCommon, 'create_volume')
     def test_create_volume(self, mock_create):
-        self._test_with_mock(mock_create, 'create_volume', [None],
-                             {'metadata': None})
+        self._test_with_mock(mock_create, 'create_volume', [None])
 
     @mock.patch.object(dothill_common.DotHillCommon,
                        'create_cloned_volume')
     def test_create_cloned_volume(self, mock_create):
-        self._test_with_mock(mock_create, 'create_cloned_volume', [None, None],
-                             {'metadata': None})
+        self._test_with_mock(mock_create, 'create_cloned_volume', [None, None])
 
     @mock.patch.object(dothill_common.DotHillCommon,
                        'create_volume_from_snapshot')
     def test_create_volume_from_snapshot(self, mock_create):
         self._test_with_mock(mock_create, 'create_volume_from_snapshot',
-                             [None, None], None)
+                             [None, None])
 
     @mock.patch.object(dothill_common.DotHillCommon, 'delete_volume')
     def test_delete_volume(self, mock_delete):
index 7f1ac84b24b53789c5ae8a69d59743df68cf9e85..21dc9f16c9a98e4a4c5b3535238df636bf19a09b 100644 (file)
@@ -160,11 +160,10 @@ class DotHillCommon(object):
                    'id': volume_name,
                    'size': volume_size, })
         try:
-            metadata = self.client.create_volume(volume_name,
-                                                 volume_size,
-                                                 self.backend_name,
-                                                 self.backend_type)
-            return metadata
+            self.client.create_volume(volume_name,
+                                      volume_size,
+                                      self.backend_name,
+                                      self.backend_type)
         except exception.DotHillRequestError as ex:
             LOG.exception(_LE("Creation of volume %s failed."), volume['id'])
             raise exception.Invalid(ex)
@@ -216,7 +215,6 @@ class DotHillCommon(object):
         self.client_login()
         try:
             self.client.copy_volume(orig_name, dest_name, 0, self.backend_name)
-            return None
         except exception.DotHillRequestError as ex:
             LOG.exception(_LE("Cloning of volume %s failed."),
                           volume['source_volid'])
@@ -241,7 +239,6 @@ class DotHillCommon(object):
         self.client_login()
         try:
             self.client.copy_volume(orig_name, dest_name, 0, self.backend_name)
-            return None
         except exception.DotHillRequestError as ex:
             LOG.exception(_LE("Create volume failed from snapshot: %s"),
                           snapshot['id'])
index 0c47ded05f9ea680c61ffc921f0304fe6dc99aac..443cfc5a2383ed648d6a4a44dad80cc177bb6f7f 100644 (file)
@@ -66,13 +66,13 @@ class DotHillFCDriver(cinder.volume.driver.FibreChannelDriver):
         self._check_flags()
 
     def create_volume(self, volume):
-        return {'metadata': self.common.create_volume(volume)}
+        self.common.create_volume(volume)
 
     def create_volume_from_snapshot(self, volume, src_vref):
         self.common.create_volume_from_snapshot(volume, src_vref)
 
     def create_cloned_volume(self, volume, src_vref):
-        return {'metadata': self.common.create_cloned_volume(volume, src_vref)}
+        self.common.create_cloned_volume(volume, src_vref)
 
     def delete_volume(self, volume):
         self.common.delete_volume(volume)
index de9357446c6effd62fc0f44a14768530222ff29c..84f5933c3f50584fc7d32c78c7c4170e1ebf77db 100644 (file)
@@ -92,13 +92,13 @@ class DotHillISCSIDriver(cinder.volume.driver.ISCSIDriver):
         self._check_flags()
 
     def create_volume(self, volume):
-        return {'metadata': self.common.create_volume(volume)}
+        self.common.create_volume(volume)
 
     def create_volume_from_snapshot(self, volume, src_vref):
         self.common.create_volume_from_snapshot(volume, src_vref)
 
     def create_cloned_volume(self, volume, src_vref):
-        return {'metadata': self.common.create_cloned_volume(volume, src_vref)}
+        self.common.create_cloned_volume(volume, src_vref)
 
     def delete_volume(self, volume):
         self.common.delete_volume(volume)