diff --git a/etc/heat/api-paste.ini b/etc/heat/api-paste.ini index 509d40a601..a0b48fe47e 100644 --- a/etc/heat/api-paste.ini +++ b/etc/heat/api-paste.ini @@ -96,7 +96,7 @@ paste.filter_factory = heat.common.custom_backend_auth:filter_factory # Middleware to set x-openstack-request-id in http response header [filter:request_id] -paste.filter_factory = heat.openstack.common.middleware.request_id:RequestIdMiddleware.factory +paste.filter_factory = oslo.middleware.request_id:RequestId.factory [filter:osprofiler] paste.filter_factory = osprofiler.web:WsgiMiddleware.factory diff --git a/heat/common/context.py b/heat/common/context.py index 2e4b78d060..f612d2c45b 100644 --- a/heat/common/context.py +++ b/heat/common/context.py @@ -11,6 +11,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo.middleware import request_id as oslo_request_id from oslo.utils import importutils from heat.common import exception @@ -20,7 +21,6 @@ from heat.db import api as db_api from heat.engine import clients from heat.openstack.common import context from heat.openstack.common import local -from heat.openstack.common.middleware import request_id class RequestContext(context.RequestContext): @@ -156,7 +156,7 @@ class ContextMiddleware(wsgi.Middleware): if roles is not None: roles = roles.split(',') token_info = environ.get('keystone.token_info') - req_id = environ.get(request_id.ENV_REQUEST_ID) + req_id = environ.get(oslo_request_id.ENV_REQUEST_ID) except Exception: raise exception.NotAuthenticated() diff --git a/heat/tests/test_common_context.py b/heat/tests/test_common_context.py index 4696f65b2b..6663465779 100644 --- a/heat/tests/test_common_context.py +++ b/heat/tests/test_common_context.py @@ -14,11 +14,11 @@ import mock import os from oslo.config import cfg +from oslo.middleware import request_id import webob from heat.common import context from heat.common import exception -from heat.openstack.common.middleware import request_id from heat.openstack.common import policy as base_policy from heat.tests import common