- allhosts = function_ldapinfo('*', required+optional )
- res = {}
- allhosts.each_pair do |hostname, host|
- # If a returned value doesn't have all the attributes we're searching for, skip
- # We'll skip if the array is empty, but we also seem to get back a nil object for empty attributes sometimes
- next if required.any?{ |a| not host[a] or host[a].empty? }
- res[hostname] = host
- end
+ allhosts = function_ldapinfo(['*', *(required+optional) ])
+ res = {}
+ allhosts.each_pair do |hostname, host|
+ # If a returned value doesn't have all the attributes we're searching for, skip
+ # We'll skip if the array is empty, but we also seem to get back a nil object for empty attributes sometimes
+ next if required.any?{ |a| not host[a] or host[a].empty? }
+ res[hostname] = host
+ end