def _list_hosts():
 count = 0
 hfn = __get_hosts_filename()
 ret = odict.OrderedDict()
 if (not os.path.isfile(hfn)):
  return ret
 with salt.utils.fopen(hfn) as ifile:
  for line in ifile:
   line = line.strip()
   if (not line):
    continue
   if line.startswith('#'):
    ret.setdefault('comment-{0}'.format(count), []).extend(line)
    count += 1
    continue
   if ('#' in line):
    line = line[:line.index('#')].strip()
   comps = line.split()
   ip = comps.pop(0)
   ret.setdefault(ip, []).extend(comps)
 return ret

def _list_hosts ( ) : count = 0 hfn = __get_hosts_filename ( ) ret = odict . OrderedDict ( ) if ( not os . path . isfile ( hfn ) ) : return ret with salt . utils . fopen ( hfn ) as ifile : for line in ifile : line = line . strip ( ) if ( not line ) : continue if line . startswith ( '#' ) : ret . setdefault ( 'comment-{0}' . format ( count ) , [ ] ) . extend ( line ) count += 1 continue if ( '#' in line ) : line = line [ : line . index ( '#' ) ] . strip ( ) comps = line . split ( ) ip = comps . pop ( 0 ) ret . setdefault ( ip , [ ] ) . extend ( comps ) return ret
return the hosts found in the hosts file in as an ordereddict .