Merge "Fix the status code of over quota response"

This commit is contained in:
Zuul 2018-11-02 04:39:53 +00:00 committed by Gerrit Code Review
commit 33069b0547
2 changed files with 2 additions and 6 deletions

View File

@ -470,12 +470,7 @@ class ContainersController(base.Controller):
except TypeError as e:
raise e
check_kwargs[res_name] = total
try:
QUOTAS.limit_check(context, project_id, **check_kwargs)
except exception.OverQuota as exc:
# Set HTTP response status code
pecan.response.status = 403
raise exc
QUOTAS.limit_check(context, project_id, **check_kwargs)
_check_deltas(context, deltas)

View File

@ -712,6 +712,7 @@ class ServerNotUsable(ZunException):
class OverQuota(ZunException):
message = _("Quota exceeded for resources: %(overs)s")
code = 403
class QuotaNotFound(NotFound):