Merge "Fix compatibility with oslo.context >= 4.0.0"
This commit is contained in:
commit
28f94b0c64
@ -153,7 +153,10 @@ def _extract_mistral_auth_params(headers):
|
|||||||
'insecure': insecure,
|
'insecure': insecure,
|
||||||
'auth_token': headers.get('X-Target-Auth-Token'),
|
'auth_token': headers.get('X-Target-Auth-Token'),
|
||||||
'auth_uri': headers.get('X-Target-Auth-Uri'),
|
'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'),
|
'tenant': headers.get('X-Target-Project-Id'),
|
||||||
|
'project_id': headers.get('X-Target-Project-Id'),
|
||||||
'user': headers.get('X-Target-User-Id'),
|
'user': headers.get('X-Target-User-Id'),
|
||||||
'user_name': headers.get('X-Target-User-Name'),
|
'user_name': headers.get('X-Target-User-Name'),
|
||||||
'region_name': headers.get('X-Target-Region-Name'),
|
'region_name': headers.get('X-Target-Region-Name'),
|
||||||
|
@ -51,7 +51,10 @@ def get_context(default=True, admin=False):
|
|||||||
return auth_context.MistralContext.from_dict({
|
return auth_context.MistralContext.from_dict({
|
||||||
'user_name': 'test-user',
|
'user_name': 'test-user',
|
||||||
'user': '1-2-3-4',
|
'user': '1-2-3-4',
|
||||||
|
# TODO(tkajinam): Remove this once oslo.context >= 4.0.0 becomes
|
||||||
|
# avaialble
|
||||||
'tenant': security.DEFAULT_PROJECT_ID,
|
'tenant': security.DEFAULT_PROJECT_ID,
|
||||||
|
'project_id': security.DEFAULT_PROJECT_ID,
|
||||||
'project_name': 'test-project',
|
'project_name': 'test-project',
|
||||||
'is_admin': admin
|
'is_admin': admin
|
||||||
})
|
})
|
||||||
@ -59,7 +62,10 @@ def get_context(default=True, admin=False):
|
|||||||
return auth_context.MistralContext.from_dict({
|
return auth_context.MistralContext.from_dict({
|
||||||
'user_name': 'test-user',
|
'user_name': 'test-user',
|
||||||
'user': '9-0-44-5',
|
'user': '9-0-44-5',
|
||||||
|
# TODO(tkajinam): Remove this once oslo.context >= 4.0.0 becomes
|
||||||
|
# avaialble
|
||||||
'tenant': '99-88-33',
|
'tenant': '99-88-33',
|
||||||
|
'project_id': '99-88-33',
|
||||||
'project_name': 'test-another',
|
'project_name': 'test-another',
|
||||||
'is_admin': admin
|
'is_admin': admin
|
||||||
})
|
})
|
||||||
|
@ -104,7 +104,7 @@ class EventEngineTest(base.DbTestCase):
|
|||||||
auth_context.set_ctx(self.ctx)
|
auth_context.set_ctx(self.ctx)
|
||||||
|
|
||||||
t['scope'] = 'public'
|
t['scope'] = 'public'
|
||||||
t['project_id'] = self.ctx.tenant
|
t['project_id'] = self.ctx.project_id
|
||||||
trigger = db_api.create_event_trigger(t)
|
trigger = db_api.create_event_trigger(t)
|
||||||
|
|
||||||
# Switch to the user.
|
# Switch to the user.
|
||||||
|
Loading…
Reference in New Issue
Block a user