def oo_get_hosts_from_hostvars(hostvars, hosts):
 retval = []
 for host in hosts:
  try:
   retval.append(hostvars[host])
  except errors.AnsibleError:
   pass
 return retval

def oo_get_hosts_from_hostvars ( hostvars , hosts ) : retval = [ ] for host in hosts : try : retval . append ( hostvars [ host ] ) except errors . AnsibleError : pass return retval
return a list of hosts from hostvars .