Context class should initialise its own data
This is a trivial cleanup. A superclass was initialising data which was only used in a subclass. Change-Id: I6930fdaef3dcb960f6baaedbd191e22b565f319e
This commit is contained in:
parent
6b9fd15072
commit
df06a326de
|
@ -59,7 +59,6 @@ class ContextBase(oslo_context.RequestContext):
|
|||
if not timestamp:
|
||||
timestamp = datetime.datetime.utcnow()
|
||||
self.timestamp = timestamp
|
||||
self._session = None
|
||||
self.roles = roles or []
|
||||
self.is_advsvc = self.is_admin or policy.check_is_advsvc(self)
|
||||
if self.is_admin is None:
|
||||
|
@ -116,6 +115,10 @@ class ContextBase(oslo_context.RequestContext):
|
|||
|
||||
|
||||
class Context(ContextBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Context, self).__init__(*args, **kwargs)
|
||||
self._session = None
|
||||
|
||||
@property
|
||||
def session(self):
|
||||
if self._session is None:
|
||||
|
|
Loading…
Reference in New Issue