summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorNaveed Massjouni <naveedm9@gmail.com>2012-01-09 21:51:09 +0000
committerNaveed Massjouni <naveedm9@gmail.com>2012-01-10 20:52:09 +0000
commit5165320257b18ca1917727c1ae1d3cdde366d85d (patch)
tree4aa12b78117561dbc9e103f97c654159ac25e2a5 /nova/api
parent52cd737df4e220291185d1145e4c124d93c39664 (diff)
Adding the request id to response headers.
bp:nova-request-response-id Change-Id: Ie2d49337010f6e7a540018f9c8d542b6c8ebbce2
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/wsgi.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py
index bc19a0ae6..7c23d564c 100644
--- a/nova/api/openstack/wsgi.py
+++ b/nova/api/openstack/wsgi.py
@@ -438,6 +438,9 @@ class ResponseHeadersSerializer(ActionDispatcher):
def serialize(self, response, data, action):
self.dispatch(response, data, action=action)
+ context = response.request.environ.get('nova.context')
+ if context:
+ response.headers['X-Compute-Request-Id'] = context.request_id
def default(self, response, data):
response.status_int = 200
@@ -464,7 +467,7 @@ class ResponseSerializer(object):
:param content_type: expected mimetype of serialized response body
"""
- response = webob.Response()
+ response = webob.Response(request=request)
self.serialize_headers(response, response_data, action)
self.serialize_body(request, response, response_data, content_type,
action)