Hi,
I have some questions to ask.
First, I see in the newest ryu version, there is an event called 
EventDPReconnected in ryu.controller.dpset.
I want to handle this event, using following code, is it right?
from ryu.base import app_managerfrom ryu.controller import ofp_eventfrom 
ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHERfrom 
ryu.controller.handler import set_ev_clsfrom ryu.controller.dpset import 
EventDPReconnected
@set_ev_cls(EventDPReconnected)
    def _switch_reconnected_handler(self, ev):
        print ev
Second, I am using ryu.topology to receive the event of swtich entering or 
leaving the network.
from ryu.topology import api as topo_api
from ryu.topology import event as topo_event
@set_ev_cls(topo_event.EventSwitchEnter)
    def _switch_enter_handler(self, ev):        console.info("enter an openflow 
switch with datapath - 
"+str(ev.switch.dp.id))@set_ev_cls(topo_event.EventSwitchLeave)
    def _switch_leave_handler(self, ev):
        console.info("leave an openflow switch with datapath - 
"+str(ev.switch.dp.id))
But I encountered a problem. It seems that when ryu shows warning message with 
multiple messages, it will trigger EventSwitchLeave twice, and the second will 
show error with "AttributeError: 'NoneType' object has no attribute 'dp'"!
Here is how to hit the problem.
1) create a switch connecting with ryu, and shutdown the switch. Warning: not 
using reboot command to shutdown, just pull off the power supply.2) restart the 
switch, and this will cause multiple warnings3) also, this will trigger 
EventSwitchLeave twice, and the second will show the error
Thanks!
Zhao Jun                                          
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to