Merge "Fix getting out-of-date volume operation state issue for VNX"
This commit is contained in:
commit
a5c988f93e
@ -1713,7 +1713,7 @@ Time Remaining: 0 second(s)
|
|||||||
expected = [mock.call(*self.testData.SNAP_CREATE_CMD('snapshot1'),
|
expected = [mock.call(*self.testData.SNAP_CREATE_CMD('snapshot1'),
|
||||||
poll=False),
|
poll=False),
|
||||||
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
||||||
poll=False),
|
poll=True),
|
||||||
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
||||||
poll=False),
|
poll=False),
|
||||||
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
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),
|
expected = [mock.call(*self.testData.LUN_EXTEND_CMD('vol1', 2),
|
||||||
poll=False),
|
poll=False),
|
||||||
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
||||||
poll=False),
|
poll=True),
|
||||||
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
||||||
poll=False),
|
poll=False),
|
||||||
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
mock.call(*self.testData.LUN_PROPERTY_ALL_CMD('vol1'),
|
||||||
|
@ -1219,14 +1219,18 @@ class CommandLineHelper(object):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
def get_lun_current_ops_state(self, name, poll=False):
|
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]
|
return data[self.LUN_OPERATION.key]
|
||||||
|
|
||||||
def wait_until_lun_ready_for_ops(self, name):
|
def wait_until_lun_ready_for_ops(self, name):
|
||||||
def is_lun_ready_for_ops():
|
def is_lun_ready_for_ops():
|
||||||
data = self.get_lun_current_ops_state(name, False)
|
data = self.get_lun_current_ops_state(name, False)
|
||||||
return data == 'None'
|
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):
|
def get_pool(self, name, properties=POOL_ALL, poll=True):
|
||||||
data = self.get_pool_properties(('-name', name),
|
data = self.get_pool_properties(('-name', name),
|
||||||
|
Loading…
Reference in New Issue
Block a user