diff --git a/mistral/context.py b/mistral/context.py index 1746a509a..cd04b0522 100644 --- a/mistral/context.py +++ b/mistral/context.py @@ -153,7 +153,10 @@ def _extract_mistral_auth_params(headers): 'insecure': insecure, 'auth_token': headers.get('X-Target-Auth-Token'), 'auth_uri': headers.get('X-Target-Auth-Uri'), + # TODO(tkajinam): Remove this once oslo.context >= 4.0.0 becomes + # avaialble 'tenant': headers.get('X-Target-Project-Id'), + 'project_id': headers.get('X-Target-Project-Id'), 'user': headers.get('X-Target-User-Id'), 'user_name': headers.get('X-Target-User-Name'), 'region_name': headers.get('X-Target-Region-Name'), diff --git a/mistral/tests/unit/base.py b/mistral/tests/unit/base.py index 0453560f9..c06ebd0de 100644 --- a/mistral/tests/unit/base.py +++ b/mistral/tests/unit/base.py @@ -51,7 +51,10 @@ def get_context(default=True, admin=False): return auth_context.MistralContext.from_dict({ 'user_name': 'test-user', 'user': '1-2-3-4', + # TODO(tkajinam): Remove this once oslo.context >= 4.0.0 becomes + # avaialble 'tenant': security.DEFAULT_PROJECT_ID, + 'project_id': security.DEFAULT_PROJECT_ID, 'project_name': 'test-project', 'is_admin': admin }) @@ -59,7 +62,10 @@ def get_context(default=True, admin=False): return auth_context.MistralContext.from_dict({ 'user_name': 'test-user', 'user': '9-0-44-5', + # TODO(tkajinam): Remove this once oslo.context >= 4.0.0 becomes + # avaialble 'tenant': '99-88-33', + 'project_id': '99-88-33', 'project_name': 'test-another', 'is_admin': admin }) diff --git a/mistral/tests/unit/services/test_event_engine.py b/mistral/tests/unit/services/test_event_engine.py index d051747dd..69ede79e5 100644 --- a/mistral/tests/unit/services/test_event_engine.py +++ b/mistral/tests/unit/services/test_event_engine.py @@ -104,7 +104,7 @@ class EventEngineTest(base.DbTestCase): auth_context.set_ctx(self.ctx) t['scope'] = 'public' - t['project_id'] = self.ctx.tenant + t['project_id'] = self.ctx.project_id trigger = db_api.create_event_trigger(t) # Switch to the user.