Merge "[placement] reorder middleware to correct logging context"

This commit is contained in:
Jenkins 2016-10-07 12:11:29 +00:00 committed by Gerrit Code Review
commit fb0ed6dc45

View File

@ -49,12 +49,20 @@ def deploy(conf, project_name):
application = handler.PlacementHandler()
for middleware in (context_middleware,
auth_middleware,
microversion_middleware,
# NOTE(cdent): The ordering here is important. The list is ordered
# from the inside out. For a single request req_id_middleware is called
# first and microversion_middleware last. Then the request is finally
# passed to the application (the PlacementHandler). At that point
# the response ascends the middleware in the reverse of the
# order the request went in. This order ensures that log messages
# all see the same contextual information including request id and
# authentication information.
for middleware in (microversion_middleware,
fault_wrap,
req_id_middleware,
request_log,
context_middleware,
auth_middleware,
req_id_middleware,
):
application = middleware(application)