#NEWLINE# def run_idl( self , txn ) : #NEWLINE# #INDENT# bridge = idlutils . row_by_value ( self . api . idl , 'Bridge' , 'name' , 'br-int' ) #NEWLINE# port_name = ( 'df-' + self . chassis . get_name ( ) ) #NEWLINE# interface = txn . insert ( self . api . idl . tables [ 'Interface' ] ) #NEWLINE# interface . name = port_name #NEWLINE# interface . type = self . chassis . get_encap_type ( ) #NEWLINE# options_dict = getattr ( interface , 'options' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# options_dict [ 'remote_ip' ] = self . chassis . get_ip ( ) #NEWLINE# options_dict [ 'key' ] = 'flow' #NEWLINE# interface . options = options_dict #NEWLINE# port = txn . insert ( self . api . idl . tables [ 'Port' ] ) #NEWLINE# port . name = port_name #NEWLINE# port . verify ( 'interfaces' ) #NEWLINE# ifaces = getattr ( port , 'interfaces' , [ ] ) #NEWLINE# ifaces . append ( interface ) #NEWLINE# port . interfaces = ifaces #NEWLINE# external_ids_dict = getattr ( interface , 'external_ids' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# external_ids_dict [ 'df-chassis-id' ] = self . chassis . get_name ( ) #NEWLINE# port . external_ids = external_ids_dict #NEWLINE# bridge . verify ( 'ports' ) #NEWLINE# ports = getattr ( bridge , 'ports' , [ ] ) #NEWLINE# ports . append ( port ) #NEWLINE# bridge . ports = ports