]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Update update_migrated_volume in VNX driver
authorpeter_wang <peter.wang13@emc.com>
Mon, 17 Aug 2015 14:33:18 +0000 (10:33 -0400)
committerPeter Wang <peter.wang13@emc.com>
Tue, 8 Sep 2015 05:31:59 +0000 (05:31 +0000)
Cinder framework adds an extra 'original_volume_status' in
update_migrated_volume.
Driver interface needs to update accordingly.

Change-Id: I59b3343529dd0a4c1f7ab3e74f203d6503f12697
Closes-Bug: 1486359

cinder/tests/unit/test_emc_vnxdirect.py
cinder/volume/drivers/emc/emc_cli_fc.py
cinder/volume/drivers/emc/emc_cli_iscsi.py
cinder/volume/drivers/emc/emc_vnx_cli.py

index b0190a26a5f57f34c4109f6292feeaf967cdaaf8..7c6385c9f398921cd571defe643a125d3c3bf588 100644 (file)
@@ -127,7 +127,9 @@ class EMCVNXCLIDriverTestData(object):
         'display_name': 'vol2',
         'consistencygroup_id': None,
         'display_description': 'test volume',
-        'volume_type_id': None}
+        'volume_type_id': None,
+        'provider_location': 'system^FNM11111|type^lun|id^1|version^05.03.00',
+        'volume_metadata': [{'key': 'lun_type', 'value': 'lun'}]}
 
     volume_in_cg = {
         'name': 'vol2',
@@ -4169,6 +4171,14 @@ Time Remaining:  0 second(s)
             'volume_id': '1'}
         self.assertEqual(expected_info, connect_info)
 
+    def test_update_migrated_volume(self):
+        self.driverSetup()
+        expected_update = {'metadata': {'lun_type': 'lun'}}
+        model_update = self.driver.update_migrated_volume(
+            None, self.testData.test_volume,
+            self.testData.test_volume2, 'available')
+        self.assertDictMatch(expected_update, model_update)
+
 
 class EMCVNXCLIDArrayBasedDriverTestCase(DriverTestCaseBase):
     def setUp(self):
index 8dcd142c884c6d51e1f35a22d47775d05f15b7dd..d235c7db4976831e32a119adac5f0d9a5f7cb5cd 100644 (file)
@@ -269,9 +269,11 @@ class EMCCLIFCDriver(driver.FibreChannelDriver):
                                                          cgsnapshot,
                                                          snapshots)
 
-    def update_migrated_volume(self, context, volume, new_volume):
+    def update_migrated_volume(self, context, volume, new_volume,
+                               original_volume_status=None):
         """Returns model update for migrated volume."""
-        return self.cli.update_migrated_volume(context, volume, new_volume)
+        return self.cli.update_migrated_volume(context, volume, new_volume,
+                                               original_volume_status)
 
     def create_export_snapshot(self, context, snapshot, connector):
         """Creates a snapshot mount point for snapshot."""
index 332fc8fae556e78997a1388d92dc2a5d5445c46d..236a59031891f6bf99a28f93076cc1b8e7e7c75a 100644 (file)
@@ -248,9 +248,11 @@ class EMCCLIISCSIDriver(driver.ISCSIDriver):
                                                          cgsnapshot,
                                                          snapshots)
 
-    def update_migrated_volume(self, context, volume, new_volume):
+    def update_migrated_volume(self, context, volume, new_volume,
+                               original_volume_status=None):
         """Returns model update for migrated volume."""
-        return self.cli.update_migrated_volume(context, volume, new_volume)
+        return self.cli.update_migrated_volume(context, volume, new_volume,
+                                               original_volume_status)
 
     def create_export_snapshot(self, context, snapshot, connector):
         """Creates a snapshot mount point for snapshot."""
index d0d51c671e07a58ff44c1b8a2d6000c0475b70cf..e3af3fda840d7064c1f8f7be7b8b0c7ba985129f 100644 (file)
@@ -2265,7 +2265,8 @@ class EMCVnxCliBase(object):
                         'metadata': volume_metadata}
         return moved, model_update
 
-    def update_migrated_volume(self, context, volume, new_volume):
+    def update_migrated_volume(self, context, volume, new_volume,
+                               original_volume_status):
         lun_type = self._extract_provider_location_for_lun(
             new_volume['provider_location'], 'type')
         volume_metadata = self._get_volume_metadata(volume)