Merge "Fix compatibility with oslo.context >= 4.0.0"

This commit is contained in:
Zuul 2022-03-10 14:21:30 +00:00 committed by Gerrit Code Review
commit 28f94b0c64
3 changed files with 10 additions and 1 deletions

View File

@ -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'),

View File

@ -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
})

View File

@ -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.