Signed-off-by: Isaku Yamahata <[email protected]>
---
Changes v2 -> v3:
- new patch
---
ryu/controller/network.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ryu/controller/network.py b/ryu/controller/network.py
index a3441a8..b029507 100644
--- a/ryu/controller/network.py
+++ b/ryu/controller/network.py
@@ -108,9 +108,10 @@ class Networks(dict):
# self.add_event(network_id, dpid, port_no)
def remove_raw(self, network_id, dpid, port_no):
- if (dpid, port_no) in self[network_id]:
+ ports = self[network_id]
+ if (dpid, port_no) in ports:
+ ports.remove((dpid, port_no))
self.send_event(EventNetworkPort(network_id, dpid, port_no, False))
- self[network_id].remove((dpid, port_no))
def remove(self, network_id, dpid, port_no):
try:
@@ -168,13 +169,12 @@ class DPIDs(dict):
try:
# self.dpids[dpid][port_no] can be already deleted by
# port_deleted()
- port = self[dpid].get(port_no)
+ port = self[dpid].pop(port_no, None)
if port and port.network_id and port.mac_address:
self.send_event(EventMacAddress(dpid, port_no,
port.network_id,
port.mac_address,
False))
- self[dpid].pop(port_no, None)
except KeyError:
raise PortNotFound(dpid=dpid, port=port_no, network_id=None)
--
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