From 67b27019b0348f2de4dedc5496d9e2c181a447fa Mon Sep 17 00:00:00 2001 From: Tina Date: Thu, 17 Sep 2015 00:04:42 -0400 Subject: [PATCH] Create volume in cg enhancement in VNX driver 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 | 4 +--- cinder/volume/drivers/emc/emc_vnx_cli.py | 16 ---------------- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/cinder/tests/unit/test_emc_vnxdirect.py b/cinder/tests/unit/test_emc_vnxdirect.py index 35559e630..e560a65e5 100644 --- a/cinder/tests/unit/test_emc_vnxdirect.py +++ b/cinder/tests/unit/test_emc_vnxdirect.py @@ -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) diff --git a/cinder/volume/drivers/emc/emc_vnx_cli.py b/cinder/volume/drivers/emc/emc_vnx_cli.py index 7343bc7e4..dbcc281bc 100644 --- a/cinder/volume/drivers/emc/emc_vnx_cli.py +++ b/cinder/volume/drivers/emc/emc_vnx_cli.py @@ -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""" -- 2.45.2