Merge "Catch error_deleting state for more resources than just shares"

This commit is contained in:
Jenkins 2015-07-28 10:59:47 +00:00 committed by Gerrit Code Review
commit 238f6f634a
1 changed files with 4 additions and 4 deletions

View File

@ -375,11 +375,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):