Neutron plugin can call remove_port after network deletion for
automatic delete port like router/dhcp port. So ignore NetworkNotFound
exception.

Signed-off-by: Isaku Yamahata <[email protected]>
---
Changes v2 -> v3:
- new patch
---
 ryu/controller/network.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ryu/controller/network.py b/ryu/controller/network.py
index cf0772f..01fa727 100644
--- a/ryu/controller/network.py
+++ b/ryu/controller/network.py
@@ -369,7 +369,12 @@ class Network(app_manager.RyuApp):
         old_mac_address = self._get_old_mac(network_id, dpid, port_no)
 
         self.dpids.remove_port(dpid, port_no)
-        self.networks.remove(network_id, dpid, port_no)
+        try:
+            self.networks.remove(network_id, dpid, port_no)
+        except NetworkNotFound:
+            # port deletion can be called after network deletion
+            # due to Openstack auto deletion port.(dhcp/router port)
+            pass
         if old_mac_address is not None:
             self.mac_addresses.remove_port(network_id, dpid, port_no,
                                            old_mac_address)
-- 
1.7.10.4


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to