From 661dea6b5e1861e56bfccc8ebe1ae637a70b3cbd Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Wed, 29 Apr 2015 16:07:27 -0700 Subject: [PATCH] Context: is_admin==True implies is_advsvc=True 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/context.py b/neutron/context.py index cfaa06920..4847d06fa 100644 --- a/neutron/context.py +++ b/neutron/context.py @@ -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: -- 2.45.2