]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Context: is_admin==True implies is_advsvc=True
authorSalvatore Orlando <salv.orlando@gmail.com>
Wed, 29 Apr 2015 23:07:27 +0000 (16:07 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Thu, 30 Apr 2015 17:37:24 +0000 (10:37 -0700)
With this change is the is_admin parameter is set to True when
creating a context, the is_advsvc property is set to True as well,
without executing a pointless check with policy engine.

Closes-Bug: #1450244

Change-Id: I0a21a82692665599260d07c00c55df18fc926eb5

neutron/context.py

index cfaa06920d60877927ae28a8015d0a32456330b7..4847d06fa21206252f8b7920dbed5f6687fd48f7 100644 (file)
@@ -65,7 +65,7 @@ class ContextBase(oslo_context.RequestContext):
         self.timestamp = timestamp
         self._session = None
         self.roles = roles or []
-        self.is_advsvc = policy.check_is_advsvc(self)
+        self.is_advsvc = self.is_admin or policy.check_is_advsvc(self)
         if self.is_admin is None:
             self.is_admin = policy.check_is_admin(self)
         elif self.is_admin and load_admin_roles: