]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Avoid loading policy when processing rpc requests
authorEugene Nikanorov <enikanorov@mirantis.com>
Thu, 28 Nov 2013 08:46:41 +0000 (12:46 +0400)
committerEugene Nikanorov <enikanorov@mirantis.com>
Thu, 28 Nov 2013 09:02:02 +0000 (13:02 +0400)
When Neutron server is restarted in the environment where multiple agents
are sending rpc requests to Neutron, it causes loading of policy.json
before API extensions are loaded. That causes different policy check
failures later on.
This patch avoids loading policy when creating a Context in rpc layer.

Change-Id: I66212baa937ec1457e0d284b5445de5243a8931f
Partial-Bug: 1254555

neutron/common/rpc.py

index c2b5aae7f992ef9f7108b4bfe86e89d97d61f872..643cf5934401366c2decedcb8d3b2130d3bee181 100644 (file)
@@ -39,6 +39,7 @@ class PluginRpcDispatcher(dispatcher.RpcDispatcher):
         tenant_id = rpc_ctxt_dict.pop('tenant_id', None)
         if not tenant_id:
             tenant_id = rpc_ctxt_dict.pop('project_id', None)
-        neutron_ctxt = context.Context(user_id, tenant_id, **rpc_ctxt_dict)
+        neutron_ctxt = context.Context(user_id, tenant_id,
+                                       load_admin_roles=False, **rpc_ctxt_dict)
         return super(PluginRpcDispatcher, self).dispatch(
             neutron_ctxt, version, method, namespace, **kwargs)