From: Tina Date: Mon, 16 Mar 2015 22:55:31 +0000 (-0400) Subject: Remove the reference of volume['instance_uuid']in VNX driver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=82a1eb73d84c24bcc43cd86cf20e00dff1108763;p=openstack-build%2Fcinder-build.git Remove the reference of volume['instance_uuid']in VNX driver Multiattach feature removed the column 'instance_uuid' and 'attached_host' from volume DB model. However, these 2 fields are used by VNX driver to determine the volume's original status in retype. This patch changed the VNX driver to not use those removed fields. Change-Id: I4b4820d93e784913eeb7e485439d5f434141bcb9 Closes-Bug: 1432925 --- diff --git a/cinder/tests/test_emc_vnxdirect.py b/cinder/tests/test_emc_vnxdirect.py index 6628ae8f5..424d8f398 100644 --- a/cinder/tests/test_emc_vnxdirect.py +++ b/cinder/tests/test_emc_vnxdirect.py @@ -266,10 +266,10 @@ class EMCVNXCLIDriverTestData(): 'deleted': False, 'host': "host@backendsec#unit_test_pool", 'source_volid': None, 'provider_auth': None, - 'display_name': 'vol-test02', 'instance_uuid': None, + 'display_name': 'vol-test02', 'attach_status': 'detached', 'volume_type': [], - 'attached_host': None, + 'volume_attachment': [], 'provider_location': 'system^FNM11111|type^lun|id^1|version^05.03.00', '_name_id': None, 'volume_metadata': []} @@ -302,7 +302,8 @@ class EMCVNXCLIDriverTestData(): 'system^FNM11111|type^lun|id^4', 'host': 'ubuntu-server12@array_backend_1', 'source_volid': None, 'provider_auth': None, - 'display_name': 'vol-test02', 'instance_uuid': None, + 'display_name': 'vol-test02', + 'volume_attachment': [], 'attach_status': 'detached', 'volume_type': [], '_name_id': None, 'volume_metadata': []} @@ -320,7 +321,8 @@ class EMCVNXCLIDriverTestData(): 'system^FNM11111|type^lun|id^5|version^05.02.00', 'host': 'ubuntu-server12@array_backend_1#unit_test_pool', 'source_volid': None, 'provider_auth': None, - 'display_name': 'vol-test05', 'instance_uuid': None, + 'display_name': 'vol-test05', + 'volume_attachment': [], 'attach_status': 'detached', 'volume_type': [], '_name_id': None, 'volume_metadata': []} diff --git a/cinder/volume/drivers/emc/emc_vnx_cli.py b/cinder/volume/drivers/emc/emc_vnx_cli.py index b4526f315..75fce1483 100644 --- a/cinder/volume/drivers/emc/emc_vnx_cli.py +++ b/cinder/volume/drivers/emc/emc_vnx_cli.py @@ -1584,7 +1584,7 @@ class CommandLineHelper(object): class EMCVnxCliBase(object): """This class defines the functions to use the native CLI functionality.""" - VERSION = '05.03.02' + VERSION = '05.03.03' stats = {'driver_version': VERSION, 'storage_protocol': None, 'vendor_name': 'EMC', @@ -1809,8 +1809,7 @@ class EMCVnxCliBase(object): self._client.expand_lun_and_wait(volume['name'], new_size) def _get_original_status(self, volume): - if (volume['instance_uuid'] is None and - volume['attached_host'] is None): + if not volume['volume_attachment']: return 'available' else: return 'in-use'