]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Treat unbound port
authorGary Kotton <gkotton@redhat.com>
Tue, 30 Apr 2013 15:23:10 +0000 (15:23 +0000)
committerGary Kotton <gkotton@redhat.com>
Wed, 1 May 2013 06:32:11 +0000 (06:32 +0000)
Following a nice suggestion by S Orlando regarding the fix for
bug 1173463

Change-Id: I2fa2a2fa7852025f0c18ff27c5fffc5667ce8378

quantum/plugins/openvswitch/agent/ovs_quantum_agent.py

index 91dcda1f64cae1c50a2e1c1d7650e3107ec41941..eda4c0b91da015c630992cb2ce05507c620007f0 100644 (file)
@@ -472,12 +472,13 @@ class OVSQuantumAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
                      net_uuid)
             return
         lvm = self.local_vlan_map[net_uuid]
-        if vif_id in lvm.vif_ports:
-            if lvm.network_type == 'gre' and self.enable_tunneling:
+
+        vif_port = lvm.vif_ports.pop(vif_id, None)
+        if vif_port:
+            if self.enable_tunneling and lvm.network_type == 'gre':
                 # remove inbound unicast flow
                 self.tun_br.delete_flows(tun_id=lvm.segmentation_id,
-                                         dl_dst=lvm.vif_ports[vif_id].vif_mac)
-            del lvm.vif_ports[vif_id]
+                                         dl_dst=vif_port.vif_mac)
         else:
             LOG.info(_('port_unbound: vif_id %s not in local_vlan_map'),
                      vif_id)