Merge "Drop redundant code to initialize RequestContext"

This commit is contained in:
Zuul 2023-12-15 05:38:21 +00:00 committed by Gerrit Code Review
commit 0967d76321

View File

@ -24,7 +24,6 @@ from oslo_context import context
from oslo_db.sqlalchemy import enginefacade from oslo_db.sqlalchemy import enginefacade
from oslo_log import log as logging from oslo_log import log as logging
import oslo_messaging import oslo_messaging
from oslo_middleware import request_id as oslo_request_id
from oslo_utils import importutils from oslo_utils import importutils
from heat.common import config from heat.common import config
@ -80,23 +79,15 @@ class RequestContext(context.RequestContext):
""" """
def __init__(self, username=None, password=None, aws_creds=None, def __init__(self, username=None, password=None, aws_creds=None,
auth_url=None, roles=None, is_admin=None, read_only=False, auth_url=None, is_admin=None, trust_id=None,
show_deleted=False, overwrite=True, trust_id=None, trustor_user_id=None, auth_token_info=None, region_name=None,
trustor_user_id=None, request_id=None, auth_token_info=None, auth_plugin=None, trusts_auth_plugin=None,
region_name=None, auth_plugin=None, trusts_auth_plugin=None, **kwargs):
user_domain_id=None, project_domain_id=None,
project_name=None, **kwargs):
"""Initialisation of the request context. """Initialisation of the request context.
:param overwrite: Set to False to ensure that the greenthread local
copy of the index is not overwritten.
""" """
super(RequestContext, self).__init__( super(RequestContext, self).__init__(
is_admin=is_admin, read_only=read_only, is_admin=is_admin, **kwargs)
show_deleted=show_deleted, request_id=request_id,
roles=roles, user_domain_id=user_domain_id,
project_domain_id=project_domain_id,
overwrite=overwrite, **kwargs)
self.username = username self.username = username
self.password = password self.password = password
@ -104,7 +95,6 @@ class RequestContext(context.RequestContext):
self.username = self.user_name self.username = self.user_name
self.region_name = region_name self.region_name = region_name
self.aws_creds = aws_creds self.aws_creds = aws_creds
self.project_name = project_name
self.auth_token_info = auth_token_info self.auth_token_info = auth_token_info
self.auth_url = auth_url self.auth_url = auth_url
self._session = None self._session = None
@ -371,7 +361,6 @@ class ContextMiddleware(wsgi.Middleware):
token_info = environ.get('keystone.token_info') token_info = environ.get('keystone.token_info')
auth_plugin = environ.get('keystone.token_auth') auth_plugin = environ.get('keystone.token_auth')
req_id = environ.get(oslo_request_id.ENV_REQUEST_ID)
req.context = self.ctxcls.from_environ( req.context = self.ctxcls.from_environ(
environ, environ,
@ -380,7 +369,6 @@ class ContextMiddleware(wsgi.Middleware):
username=username, username=username,
password=password, password=password,
auth_url=auth_url, auth_url=auth_url,
request_id=req_id,
user_domain_id=user_domain_id, user_domain_id=user_domain_id,
project_domain_id=project_domain_id, project_domain_id=project_domain_id,
auth_token_info=token_info, auth_token_info=token_info,