#NEWLINE# @ set_ev_cls ( stplib . EventTopologyChange , MAIN_DISPATCHER ) #NEWLINE# def _topology_change_handler( self , ev ) : #NEWLINE# #INDENT# dp = ev . dp #NEWLINE# dpid_str = dpid_lib . dpid_to_str ( dp . id ) #NEWLINE# msg = 'Receive topology change event. Flush MAC table.' #NEWLINE# self . logger . debug ( '[dpid=%s] %s' , dpid_str , msg ) #NEWLINE# if ( dp . id in self . mac_to_port ) : #NEWLINE# #INDENT# del self . mac_to_port [ dp . id ] #NEWLINE# #UNINDENT# self . delete_flow ( msg )