Merge "Fix getting out-of-date volume operation state issue for VNX"

This commit is contained in:
Jenkins 2015-07-17 04:48:03 +00:00 committed by Gerrit Code Review
commit a5c988f93e
2 changed files with 8 additions and 4 deletions

View File

@ -1713,7 +1713,7 @@ Time Remaining: 0 second(s)
expected = [mock.call(*self.testData.SNAP_CREATE_CMD('snapshot1'),
poll=False),
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
poll=False),
poll=True),
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
poll=False),
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
@ -2439,7 +2439,7 @@ Time Remaining: 0 second(s)
expected = [mock.call(*self.testData.LUN_EXTEND_CMD('vol1', 2),
poll=False),
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
poll=False),
poll=True),
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
poll=False),
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),

View File

@ -1219,14 +1219,18 @@ class CommandLineHelper(object):
return data
def get_lun_current_ops_state(self, name, poll=False):
data = self.get_lun_by_name(name, poll=False)
data = self.get_lun_by_name(name, poll=poll)
return data[self.LUN_OPERATION.key]
def wait_until_lun_ready_for_ops(self, name):
def is_lun_ready_for_ops():
data = self.get_lun_current_ops_state(name, False)
return data == 'None'
self._wait_for_a_condition(is_lun_ready_for_ops)
# Get the volume's latest operation state by polling.
# Otherwise, the operation state may be out of date.
ops = self.get_lun_current_ops_state(name, True)
if ops != 'None':
self._wait_for_a_condition(is_lun_ready_for_ops)
def get_pool(self, name, properties=POOL_ALL, poll=True):
data = self.get_pool_properties(('-name', name),