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:
Andrew Kerr 2015-07-08 09:36:25 -04:00
parent 0de9d3f993
commit 22bd34a04c
1 changed files with 4 additions and 4 deletions

View File

@ -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):