Fix meaningless quota exceeded exception info

When updating a nested quota with exceeded value, a meaningless
info is returned to user.

In Cinder, exception's attribute 'message' is a format string,
not including details. We need to use 'msg' instead of it.

See:
https://github.com/openstack/cinder/blob/master/cinder/exception.py#L122-L126

Thanks to ChangBo Guo(gcb) who find this:
https://review.openstack.org/#/c/285712/

Change-Id: I99c891b865ec507875d2a48e3e7d1f4a3b1bb9cb
Closes-bug: 1561413
This commit is contained in:
Cao ShuFeng
2016-03-24 17:29:36 +08:00
parent 4fcf249df8
commit 8a9e86c117

View File

@@ -287,7 +287,7 @@ class QuotaSetsController(wsgi.Controller):
except exception.OverQuota as e:
if reservations:
db.reservation_rollback(context, reservations)
raise webob.exc.HTTPBadRequest(explanation=e.message)
raise webob.exc.HTTPBadRequest(explanation=e.msg)
valid_quotas[key] = value