diff --git a/nova/api/openstack/placement/deploy.py b/nova/api/openstack/placement/deploy.py index 9d9ee30be..269a974ee 100644 --- a/nova/api/openstack/placement/deploy.py +++ b/nova/api/openstack/placement/deploy.py @@ -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)