summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-11-16 05:06:44 +0000
committerGerrit Code Review <review@openstack.org>2012-11-16 05:06:44 +0000
commita5d0714fdf3d0777b1174f3ebd02373cc57114a8 (patch)
tree3f9a8464e34ac05b3c54e1d50913279b2c2150d0
parentb6aa1d2b02b020b0c2f984228205f773e27066c2 (diff)
parent3f95c7a4aaaf44e029d86ce2b7d46c1315e908e4 (diff)
Merge "don't explode if a 413 didn't set Retry-After"
-rw-r--r--nova/api/openstack/wsgi.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index 868d4f05a..d28345dd8 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -1181,8 +1181,9 @@ class Fault(webob.exc.HTTPException):
'code': code,
'message': self.wrapped_exc.explanation}}
if code == 413:
- retry = self.wrapped_exc.headers['Retry-After']
- fault_data[fault_name]['retryAfter'] = retry
+ retry = self.wrapped_exc.headers.get('Retry-After', None)
+ if retry:
+ fault_data[fault_name]['retryAfter'] = retry
# 'code' is an attribute on the fault tag itself
metadata = {'attributes': {fault_name: 'code'}}