diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-09-19 18:05:15 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-09-19 18:05:15 +0000 |
| commit | 8473bb4cf93eb713ef42fdc87767aa938f36b43e (patch) | |
| tree | c042352b533bb3bcb70aae20a135e0a80a7d4470 /nova/api | |
| parent | b46f224f7555e3065b0daacd101b65d86117f0c1 (diff) | |
| parent | e8c37d13eac37210bc34b4ca99e4539c67457120 (diff) | |
Merge "Fix over rate limit error response"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/wsgi.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index f7a013feb..33db3e714 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -1198,10 +1198,11 @@ class OverLimitFault(webob.exc.HTTPException): hdrs = OverLimitFault._retry_after(retry_time) self.wrapped_exc = webob.exc.HTTPRequestEntityTooLarge(headers=hdrs) self.content = { - "overLimitFault": { + "overLimit": { "code": self.wrapped_exc.status_int, "message": message, "details": details, + "retryAfter": hdrs['Retry-After'], }, } @@ -1219,7 +1220,7 @@ class OverLimitFault(webob.exc.HTTPException): error format. """ content_type = request.best_match_content_type() - metadata = {"attributes": {"overLimitFault": "code"}} + metadata = {"attributes": {"overLimit": ["code", "retryAfter"]}} xml_serializer = XMLDictSerializer(metadata, XMLNS_V11) serializer = { @@ -1229,6 +1230,7 @@ class OverLimitFault(webob.exc.HTTPException): content = serializer.serialize(self.content) self.wrapped_exc.body = content + self.wrapped_exc.content_type = content_type return self.wrapped_exc |
