diff --git a/keystone/middleware/core.py b/keystone/middleware/core.py index 04c74f6b07..c065997e49 100644 --- a/keystone/middleware/core.py +++ b/keystone/middleware/core.py @@ -13,6 +13,7 @@ # under the License. from oslo_config import cfg +from oslo_context import context as oslo_context from oslo_log import log from oslo_log import versionutils from oslo_middleware import sizelimit @@ -280,6 +281,11 @@ def _validate_trusted_issuer(self, env): return False def process_request(self, request): + + # The request context stores itself in thread-local memory for logging. + oslo_context.RequestContext( + request_id=request.environ.get('openstack.request_id')) + if authorization.AUTH_CONTEXT_ENV in request.environ: msg = _LW('Auth context already exists in the request ' 'environment; it will be used for authorization ' diff --git a/requirements.txt b/requirements.txt index eff807920f..fc4c816511 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,6 +20,7 @@ python-keystoneclient>=1.6.0 keystonemiddleware>=2.0.0 oslo.concurrency>=2.3.0 # Apache-2.0 oslo.config>=2.3.0 # Apache-2.0 +oslo.context>=0.2.0 # Apache-2.0 oslo.messaging!=1.17.0,!=1.17.1,>=1.16.0 # Apache-2.0 oslo.db>=2.4.1 # Apache-2.0 oslo.i18n>=1.5.0 # Apache-2.0