]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Create volume in cg enhancement in VNX driver
authorTina <tina.tang@emc.com>
Thu, 17 Sep 2015 04:04:42 +0000 (00:04 -0400)
committerTina <tina.tang@emc.com>
Wed, 23 Sep 2015 09:57:47 +0000 (09:57 +0000)
VNX driver queries whether a LUN is in CG after adding it into
CG. However, as long as the LUN is added successfully, the LUN
will be in CG. The additional query is useless. This patch removes
the additional query.

Change-Id: I1ca43616d41169ceb1f8fde460f7ec4a616c5d56
Closes-Bug: #1497900

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

index 35559e630a4a331bbc155da838339a7e158b4a03..e560a65e5242680c833d82a03f80a9b647ed1da6 100644 (file)
@@ -3705,11 +3705,9 @@ Time Remaining:  0 second(s)
     def test_add_volume_to_cg(self):
         commands = [self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
                     self.testData.ADD_LUN_TO_CG_CMD('cg_id', 1),
-                    self.testData.GET_CG_BY_NAME_CMD('cg_id')
                     ]
         results = [self.testData.LUN_PROPERTY('vol1', True),
-                   SUCCEED,
-                   self.testData.CG_PROPERTY('cg_id')]
+                   SUCCEED]
         fake_cli = self.driverSetup(commands, results)
 
         self.driver.create_volume(self.testData.test_volume_cg)
index 7343bc7e438e2c4363fe4262b7b7991ea52c070e..dbcc281bcda344a7d6f3eceef61c3a45a84d577d 100644 (file)
@@ -713,22 +713,6 @@ class CommandLineHelper(object):
                                                   'cg_name': cg_name})
             self._raise_cli_error(add_lun_to_cg_cmd, rc, out)
 
-        def add_lun_to_consistency_success():
-            data = self.get_consistency_group_by_name(cg_name)
-            if str(lun_id) in data['Luns']:
-                LOG.debug("Add lun %(lun)s to consistency "
-                          "group %(cg_name)s successfully.",
-                          {'lun': lun_id, 'cg_name': cg_name})
-                return True
-            else:
-                LOG.debug("Adding lun %(lun)s to consistency "
-                          "group %(cg_name)s.",
-                          {'lun': lun_id, 'cg_name': cg_name})
-                return False
-
-        self._wait_for_a_condition(add_lun_to_consistency_success,
-                                   interval=INTERVAL_30_SEC)
-
     def remove_luns_from_consistencygroup(self, cg_name, remove_ids,
                                           poll=False):
         """Removes LUN(s) from cg"""