From: nikeshm Date: Thu, 20 Aug 2015 20:47:12 +0000 (+0530) Subject: Avoid returning volume metadata in DotHill driver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a0b4d541cdec5e18e0eba9b318a9ef097ce3f438;p=openstack-build%2Fcinder-build.git Avoid returning volume metadata in DotHill driver 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 --- diff --git a/cinder/tests/unit/test_dothill.py b/cinder/tests/unit/test_dothill.py index b1528793b..6b9365bb1 100644 --- a/cinder/tests/unit/test_dothill.py +++ b/cinder/tests/unit/test_dothill.py @@ -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): diff --git a/cinder/volume/drivers/dothill/dothill_common.py b/cinder/volume/drivers/dothill/dothill_common.py index 7f1ac84b2..21dc9f16c 100644 --- a/cinder/volume/drivers/dothill/dothill_common.py +++ b/cinder/volume/drivers/dothill/dothill_common.py @@ -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']) diff --git a/cinder/volume/drivers/dothill/dothill_fc.py b/cinder/volume/drivers/dothill/dothill_fc.py index 0c47ded05..443cfc5a2 100644 --- a/cinder/volume/drivers/dothill/dothill_fc.py +++ b/cinder/volume/drivers/dothill/dothill_fc.py @@ -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) diff --git a/cinder/volume/drivers/dothill/dothill_iscsi.py b/cinder/volume/drivers/dothill/dothill_iscsi.py index de9357446..84f5933c3 100644 --- a/cinder/volume/drivers/dothill/dothill_iscsi.py +++ b/cinder/volume/drivers/dothill/dothill_iscsi.py @@ -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)