From e82c4ca08b7195b3e907bcf5192a45d3e5a1e31b Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 22 Jul 2021 22:24:35 +0900 Subject: [PATCH] Replace deprecated arguments of RequestContext The following arguments of the RequestContext class are deprecated since oslo.context 2.18[1]. user : renamed to user_id tenant : renamed to project_id domain : renamed to domain_id user_domain : renamed to user_domain_id project_domain: renamed to project_domain_id This change updates arguments used accordingly. [1] d78cf592e1e3e7aa0fc99bfdd655e82f5c44dfe3 Change-Id: I24a8963d112a24674ad5699685118d019ef1ed56 --- mistral/services/action_heartbeat_checker.py | 4 ++-- mistral/services/action_heartbeat_sender.py | 4 ++-- mistral/services/expiration_policy.py | 8 ++++---- mistral/services/periodic.py | 4 ++-- mistral/services/security.py | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mistral/services/action_heartbeat_checker.py b/mistral/services/action_heartbeat_checker.py index 218766b94..a603ff6e4 100644 --- a/mistral/services/action_heartbeat_checker.py +++ b/mistral/services/action_heartbeat_checker.py @@ -75,8 +75,8 @@ def _loop(): # security context. auth_ctx.set_ctx( auth_ctx.MistralContext( - user=None, - tenant=None, + user_id=None, + project_id=None, auth_token=None, is_admin=True ) diff --git a/mistral/services/action_heartbeat_sender.py b/mistral/services/action_heartbeat_sender.py index dc08bbfa3..bdb3df319 100644 --- a/mistral/services/action_heartbeat_sender.py +++ b/mistral/services/action_heartbeat_sender.py @@ -66,8 +66,8 @@ def _loop(): # security context. auth_ctx.set_ctx( auth_ctx.MistralContext( - user=None, - tenant=None, + user_id=None, + project_id=None, auth_token=None, is_admin=True ) diff --git a/mistral/services/expiration_policy.py b/mistral/services/expiration_policy.py index a71875bfd..f9f919af8 100644 --- a/mistral/services/expiration_policy.py +++ b/mistral/services/expiration_policy.py @@ -92,8 +92,8 @@ def _delete(executions): # TODO(tuan_luong): Manipulation with auth_ctx should be # out of db transaction scope. ctx = auth_ctx.MistralContext( - user=None, - tenant=execution.project_id, + user_id=None, + project_id=execution.project_id, auth_token=None, is_admin=True ) @@ -147,8 +147,8 @@ def setup(): _check_ignored_states_config() ctx = auth_ctx.MistralContext( - user=None, - tenant=None, + user_id=None, + project_id=None, auth_token=None, is_admin=True ) diff --git a/mistral/services/periodic.py b/mistral/services/periodic.py index b10ea50a0..72d67c130 100644 --- a/mistral/services/periodic.py +++ b/mistral/services/periodic.py @@ -157,8 +157,8 @@ def setup(): pt = MistralPeriodicTasks(CONF) ctx = auth_ctx.MistralContext( - user=None, - tenant=None, + user_id=None, + project_id=None, auth_token=None, is_admin=True ) diff --git a/mistral/services/security.py b/mistral/services/security.py index 93e3c207b..aaccbc0bc 100644 --- a/mistral/services/security.py +++ b/mistral/services/security.py @@ -73,16 +73,16 @@ def create_context(trust_id, project_id): user_id = client.user_id return auth_ctx.MistralContext( - user=user_id, - tenant=project_id, + user_id=user_id, + project_id=project_id, auth_token=token, is_trust_scoped=True, trust_id=trust_id, ) return auth_ctx.MistralContext( - user=None, - tenant=None, + user_id=None, + project_id=None, auth_token=None, is_admin=True )