From: Matthew Booth Date: Thu, 25 Jun 2015 09:20:08 +0000 (+0100) Subject: Context class should initialise its own data X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=df06a326de39a6792e2e82eafa5cf50eb325b34e;p=openstack-build%2Fneutron-build.git 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 --- diff --git a/neutron/context.py b/neutron/context.py index 3debe4ccd..1e3b5e822 100644 --- a/neutron/context.py +++ b/neutron/context.py @@ -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: