From bea7df6b0134eb6fffe4c6a899b574df5584e152 Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Wed, 22 Oct 2014 11:42:12 +0100 Subject: [PATCH] Move to oslo.middlware request_id module The oslo-incubator request_id module has been deprecated and removed for kilo, replaced by the request_id from oslo.middleware. Note that we need to leave the oslo-incubator request_id shim in place until after Kilo ships, so operators get fair warning about the backwards-incompatible paste.ini change. Change-Id: Iedbfede6d57312f565cf4b1ccb71a8418fad8620 Partial-Bug: #1380629 --- etc/heat/api-paste.ini | 2 +- heat/common/context.py | 4 ++-- heat/tests/test_common_context.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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