Merge "Fix the status code of over quota response"
This commit is contained in:
commit
33069b0547
@ -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)
|
||||
|
||||
|
@ -712,6 +712,7 @@ class ServerNotUsable(ZunException):
|
||||
|
||||
class OverQuota(ZunException):
|
||||
message = _("Quota exceeded for resources: %(overs)s")
|
||||
code = 403
|
||||
|
||||
|
||||
class QuotaNotFound(NotFound):
|
||||
|
Loading…
x
Reference in New Issue
Block a user