Catch error_deleting state for more resources than just shares
The shares client in tempest currently catches if a share is in 'error_deleting' state and throws a ResourceReleaseFailed exception so the tests don't have to wait for the timeout. However, more resources than just shares can go into error_deleting state, snapshots for example. This patch changes the check for error_deleting to work with all resource types. closes-bug: 1477703 Change-Id: Idc530db6593769df8f503878ce7432270ddae086
This commit is contained in:
parent
0de9d3f993
commit
22bd34a04c
|
@ -364,11 +364,11 @@ class SharesClient(rest_client.RestClient):
|
|||
res = func(res_id)
|
||||
except lib_exc.NotFound:
|
||||
return True
|
||||
if (func.__name__ == 'get_share' and
|
||||
res['status'] == 'error_deleting'):
|
||||
# Share has "error_deleting" status and can not be deleted.
|
||||
if res.get('status') == 'error_deleting':
|
||||
# Resource has "error_deleting" status and can not be deleted.
|
||||
resource_type = func.__name__.split('_', 1)[-1]
|
||||
raise share_exceptions.ResourceReleaseFailed(
|
||||
res_type='share', res_id=res_id)
|
||||
res_type=resource_type, res_id=res_id)
|
||||
return False
|
||||
|
||||
def wait_for_resource_deletion(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue