Merge "Catch CannotResizeDisk exception when resize to zero disk"

This commit is contained in:
Jenkins
2014-07-28 04:56:55 +00:00
committed by Gerrit Code Review
5 changed files with 44 additions and 3 deletions

View File

@@ -1174,6 +1174,8 @@ class Controller(wsgi.Controller):
except exception.CannotResizeToSameFlavor:
msg = _("Resize requires a flavor change.")
raise exc.HTTPBadRequest(explanation=msg)
except exception.CannotResizeDisk as e:
raise exc.HTTPBadRequest(explanation=e.format_message())
except exception.InstanceIsLocked as e:
raise exc.HTTPConflict(explanation=e.format_message())
except exception.InstanceInvalidState as state_error: