]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Wrap quota controller with resource.Resource
authorHe Jie Xu <xuhj@linux.vnet.ibm.com>
Tue, 5 Feb 2013 11:05:53 +0000 (19:05 +0800)
committerHe Jie Xu <xuhj@linux.vnet.ibm.com>
Fri, 8 Mar 2013 08:26:53 +0000 (16:26 +0800)
commit987b1a35cdb3631ab759b5ee6b63ad6ecb8e1753
treefe7357c3f425b1a715c95ae3908d58b9864729ca
parente0f567f99e36a31179d28b6d32d278716faf0db5
Wrap quota controller with resource.Resource

Fixes bug 1116137

Currently the format of error message returned by quota extension was
different with quantum other resource. Other resource will return as
json(eg, '{"QuantumError": "error message"}'). But quota extension only
return messages without any format.
'quantum.api.v2.resource.Resource' provider error messages processing.
So wrap quota controller with it.

By the way, fix some small stuff:
* Use specific exception 'QuotaTenantNotFound' instead of generic exception.
* Correct error message.
* Use attribute mapping checking the request body.

Change-Id: I71261198aa79e9ed8e0ae672de32552abdbf45c1
quantum/common/exceptions.py
quantum/extensions/quotasv2.py
quantum/tests/unit/test_quota_ext.py [moved from quantum/tests/unit/test_quota_per_tenant_ext.py with 73% similarity]