Skip to content

Commit

Permalink
iXsystems#24 use http code 422 to detect volumebusy error
Browse files Browse the repository at this point in the history
  • Loading branch information
YiHuangDB committed Feb 27, 2023
1 parent 052eade commit bff43c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion driver/ixsystems/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def _delete_snapshot(self, name, volume_name):
LOG.debug('_delete_snapshot response : %s', json.dumps(ret))
# When deleting volume with dependent snapsnot clone, 422 error triggered. Throw VolumeIsBusy exception ensures
# upper stream cinder manager mark volume status available instead of error-deleting.
if ret['status'] == 'error' and ret['response'] == '422:Unprocessable Entity':
if ret['status'] == 'error' and ret['code'] == '422':
errorexception = exception.VolumeIsBusy(
_("Cannot delete volume when clone child volume or snapshot exists!"), volume_name=name)
raise errorexception
Expand Down

0 comments on commit bff43c7

Please sign in to comment.