]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
OVS and OF Agents: Create updated_ports attribute before setup_rpc
authorEugene Nikanorov <enikanorov@mirantis.com>
Wed, 30 Apr 2014 12:04:58 +0000 (16:04 +0400)
committerEugene Nikanorov <enikanorov@mirantis.com>
Wed, 30 Apr 2014 12:04:58 +0000 (16:04 +0400)
setup_rpc spawns rpc-consuming thread that can access
self.updated_ports before it is created in the constructor

Change-Id: Icc447c3bb7099125aae30e2430a6ad98ba00f6f9
Closes-Bug: #1314472

neutron/plugins/ofagent/agent/ofa_neutron_agent.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py

index 3b57f58002d3bdd2ce65e3044a286fc03de7eae4..8eeb7577b6069f55c65d2b255387ed6417a9c7a7 100644 (file)
@@ -250,6 +250,8 @@ class OFANeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
         self.int_br_device_count = 0
 
         self.int_br = OVSBridge(integ_br, self.root_helper, self.ryuapp)
+        # Stores port update notifications for processing in main loop
+        self.updated_ports = set()
         self.setup_rpc()
         self.setup_integration_br()
         self.setup_physical_bridges(bridge_mappings)
@@ -275,8 +277,6 @@ class OFANeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
         self.sg_agent = OFASecurityGroupAgent(self.context,
                                               self.plugin_rpc,
                                               self.root_helper)
-        # Stores port update notifications for processing in main loop
-        self.updated_ports = set()
         # Initialize iteration counter
         self.iter_num = 0
 
index a92a36bf0334750ce26deb5e4aabb9a651715299..bbae1cb90fe60b300df7e863d5ca07ef72a4958d 100644 (file)
@@ -192,6 +192,8 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
         self.int_br_device_count = 0
 
         self.int_br = ovs_lib.OVSBridge(integ_br, self.root_helper)
+        # Stores port update notifications for processing in main rpc loop
+        self.updated_ports = set()
         self.setup_rpc()
         self.setup_integration_br()
         self.setup_physical_bridges(bridge_mappings)
@@ -220,8 +222,6 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
         self.sg_agent = OVSSecurityGroupAgent(self.context,
                                               self.plugin_rpc,
                                               root_helper)
-        # Stores port update notifications for processing in main rpc loop
-        self.updated_ports = set()
         # Initialize iteration counter
         self.iter_num = 0