def _fixup_cell_info(cell_info, keys):
 if ('transport_url' not in cell_info):
  return
 transport_url = cell_info.pop('transport_url')
 try:
  transport_url = rpc.get_transport_url(transport_url)
 except messaging.InvalidTransportURL:
  for key in keys:
   cell_info.setdefault(key, None)
  return
 if (not transport_url.hosts):
  return
 transport_host = transport_url.hosts[0]
 transport_field_map = {'rpc_host': 'hostname', 'rpc_port': 'port'}
 for key in keys:
  if (key in cell_info):
   continue
  transport_field = transport_field_map.get(key, key)
  cell_info[key] = getattr(transport_host, transport_field)

def _fixup_cell_info ( cell_info , keys ) : if ( 'transport_url' not in cell_info ) : return transport_url = cell_info . pop ( 'transport_url' ) try : transport_url = rpc . get_transport_url ( transport_url ) except messaging . InvalidTransportURL : for key in keys : cell_info . setdefault ( key , None ) return if ( not transport_url . hosts ) : return transport_host = transport_url . hosts [ 0 ] transport_field_map = { 'rpc_host' : 'hostname' , 'rpc_port' : 'port' } for key in keys : if ( key in cell_info ) : continue transport_field = transport_field_map . get ( key , key ) cell_info [ key ] = getattr ( transport_host , transport_field )
if the transport_url is present in the cell .