From bff43c7bebb14a0b3a62adfa700fe77f249fc3d0 Mon Sep 17 00:00:00 2001 From: YiHuangIX Date: Mon, 27 Feb 2023 17:54:10 +0000 Subject: [PATCH] #24 use http code 422 to detect volumebusy error --- driver/ixsystems/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/ixsystems/common.py b/driver/ixsystems/common.py index f758a26..de06397 100644 --- a/driver/ixsystems/common.py +++ b/driver/ixsystems/common.py @@ -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