[Ryu-devel] If want to delete switch from ryu controller
Brought to you by:
nz_gizmoguy
From: Sagar R. <sag...@gm...> - 2022-02-20 12:10:08
|
Hello, I am working on the shortest path finding application in ryu controller. I want to remove the openflow switch(dpid) from the ryu controller itself when a certain condition is satisfied. Is it possible to remove the dp id from ryu when certain conditions are satisfied ? I have tried this event method but this is not working . So how to remove any switch from ryu controller from topology based on certain condition that i am not able to figureout @set_ev_cls(topology.event.EventSwitchLeave) def switch_leave_handler(self, event): """ event handler triggered when switch leave. delete the Switch object directly, the broadcast thread will be killed by itself when exception occured next time. """ dpid = event.switch.dp.id self.logger.info('switch leave (dpid=%s)', dpid_lib.dpid_to_str(dpid)) try: del self.switches[dpid] except KeyError: pass Can any one help me regarding this? -- Thanks & Regards, Ramani Sagar V. G.E.S Class - II, Govt of Gujarat, India. |