def _list_linodes(full=False):
 nodes = _query('linode', 'list')['DATA']
 ips = get_ips()
 ret = {}
 for node in nodes:
  this_node = {}
  linode_id = str(node['LINODEID'])
  this_node['id'] = linode_id
  this_node['image'] = node['DISTRIBUTIONVENDOR']
  this_node['name'] = node['LABEL']
  this_node['size'] = node['TOTALRAM']
  state = int(node['STATUS'])
  this_node['state'] = _get_status_descr_by_id(state)
  for (key, val) in six.iteritems(ips):
   if (key == linode_id):
    this_node['private_ips'] = val['private_ips']
    this_node['public_ips'] = val['public_ips']
  if full:
   this_node['extra'] = node
  ret[node['LABEL']] = this_node
 return ret

def _list_linodes ( full = False ) : nodes = _query ( 'linode' , 'list' ) [ 'DATA' ] ips = get_ips ( ) ret = { } for node in nodes : this_node = { } linode_id = str ( node [ 'LINODEID' ] ) this_node [ 'id' ] = linode_id this_node [ 'image' ] = node [ 'DISTRIBUTIONVENDOR' ] this_node [ 'name' ] = node [ 'LABEL' ] this_node [ 'size' ] = node [ 'TOTALRAM' ] state = int ( node [ 'STATUS' ] ) this_node [ 'state' ] = _get_status_descr_by_id ( state ) for ( key , val ) in six . iteritems ( ips ) : if ( key == linode_id ) : this_node [ 'private_ips' ] = val [ 'private_ips' ] this_node [ 'public_ips' ] = val [ 'public_ips' ] if full : this_node [ 'extra' ] = node ret [ node [ 'LABEL' ] ] = this_node return ret
helper function to format and parse linode data .