]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Merge "Fix _restore_local_vlan_map race"
authorJenkins <jenkins@review.openstack.org>
Fri, 23 Oct 2015 15:45:10 +0000 (15:45 +0000)
committerGerrit Code Review <review@openstack.org>
Fri, 23 Oct 2015 15:45:10 +0000 (15:45 +0000)
1  2 
neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py

index 5d34b4fb9b1130a532062a21b083fa110b3761b1,5158c3b8c6fec9667f701aa48b6a55781765a2e3..085c093ed97e46a17075c4609f7893e2e867eae6
@@@ -355,22 -353,19 +356,17 @@@ class OVSNeutronAgent(sg_rpc.SecurityGr
              if not local_vlan:
                  continue
              net_uuid = local_vlan_map.get('net_uuid')
-             if (net_uuid and net_uuid not in self.local_vlan_map
+             if (net_uuid and net_uuid not in self._local_vlan_hints
                  and local_vlan != DEAD_VLAN_TAG):
-                 segmentation_id = local_vlan_map.get('segmentation_id')
-                 if segmentation_id == 'None':
-                     # Backward compatible check when we used to store the
-                     # string 'None' in OVS
-                     segmentation_id = None
-                 if segmentation_id is not None:
-                     segmentation_id = int(segmentation_id)
-                 self.provision_local_vlan(local_vlan_map['net_uuid'],
-                                           local_vlan_map['network_type'],
-                                           local_vlan_map['physical_network'],
-                                           segmentation_id,
-                                           local_vlan)
+                 self.available_local_vlans.remove(local_vlan)
+                 self._local_vlan_hints[local_vlan_map['net_uuid']] = \
+                     local_vlan
+     def _dispose_local_vlan_hints(self):
+         self.available_local_vlans.update(self._local_vlan_hints.values())
+         self._local_vlan_hints = {}
  
      def setup_rpc(self):
 -        self.agent_id = 'ovs-agent-%s' % self.conf.host
 -        self.topic = topics.AGENT
          self.plugin_rpc = OVSPluginApi(topics.PLUGIN)
          self.sg_plugin_rpc = sg_rpc.SecurityGroupServerRpcApi(topics.PLUGIN)
          self.dvr_plugin_rpc = dvr_rpc.DVRServerRpcApi(topics.PLUGIN)