#NEWLINE# def _fixup_cell_info( cell_info , keys ) : #NEWLINE# #INDENT# 'If the transport_url is present in the cell, derive username,\n    rpc_host, and rpc_port from it.\n    ' #NEWLINE# if ( 'transport_url' not in cell_info ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# transport_url = cell_info . pop ( 'transport_url' ) #NEWLINE# try : #NEWLINE# #INDENT# transport_url = rpc . get_transport_url ( transport_url ) #NEWLINE# #UNINDENT# except messaging . InvalidTransportURL : #NEWLINE# #INDENT# for key in keys : #NEWLINE# #INDENT# cell_info . setdefault ( key , None ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# if ( not transport_url . hosts ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# transport_host = transport_url . hosts [ 0 ] #NEWLINE# transport_field_map = { #NEWLINE# #INDENT# 'rpc_host' : 'hostname' , #NEWLINE# 'rpc_port' : 'port' , #NEWLINE# #UNINDENT# } #NEWLINE# for key in keys : #NEWLINE# #INDENT# if ( key in cell_info ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# transport_field = transport_field_map . get ( key , key ) #NEWLINE# cell_info [ key ] = getattr ( transport_host , transport_field )