#NEWLINE# def handle_port_status( self , reason , desc ) : #NEWLINE# #INDENT# with p . _features_lock : #NEWLINE# #INDENT# ports = self . _features . ports #NEWLINE# if ( reason == ofproto . OFPPR_ADD ) : #NEWLINE# #INDENT# ports = ( ports + ( desc , ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( reason == ofproto . OFPPR_DELETE ) : #NEWLINE# #INDENT# ports = tuple ( [ p for p in ports if ( p . port_no != desc . port_no ) ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ports = tuple ( [ ( desc if ( desc . port_no == p . port_no ) else p ) for p in ports ] ) #NEWLINE# #UNINDENT# #UNINDENT# self . _features = self . _features . _replace ( ports = ports ) #NEWLINE# #UNINDENT# self . controller . handle_port_status ( reason , desc )