]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Add x-openstack-request-id to cinder responses
authorChris Buccella <buccella@linux.vnet.ibm.com>
Fri, 14 Feb 2014 23:29:28 +0000 (23:29 +0000)
committerChris Buccella <buccella@linux.vnet.ibm.com>
Wed, 19 Feb 2014 17:09:23 +0000 (17:09 +0000)
commit4c8f269dd19c742bd80ce3ff7db55ff53be4af7d
treedf4e0c10bb73ddf85cd88049a1dff1d94673fb70
parentb21d0c51fed327e827447119d97f56023bb5ef38
Add x-openstack-request-id to cinder responses

x-openstack-request-id is the common header name for request ID going forward.
Currently, only glance and neutron return this header. Using the request_id
middleware is a convenient way to ensure this header is in the response. We will
also be using the middleware to generate the request ID.

The ID will be generated by the middleware and is inserted into the request
environment. The current code generates the request ID in the constructor of
RequestConext; with this change, the ID is generated beforehand and passed in to
the RequestContext constructor. Not much different here: a request ID is
generated and is available for use in the handling of the request.

On the response end, the middleware is again used, this time to attach the
x-openstack-request-id header, using the value of the generated request ID. The
current code attaches the x-compute-request-id header.

This change is a necessary step toward logging the mapping of request IDs across
OpenStack services.

UpgradeImpact: api-paste.ini is modified

Change-Id: I30c4e5efa77f9ebffb485d2ea6a6c3f78eb1573f
Implements: blueprint add-standard-req-id-header
cinder/api/middleware/auth.py
cinder/tests/api/middleware/test_auth.py
etc/cinder/api-paste.ini