X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fldapinfo.rb;h=489970e63c6ea162f033899defcea432c1bf4fa1;hb=fbdfced4d644a867a1913ff13e94fb6851bb8442;hp=3a687224dd5a5fa71173fa288ff6ba8b8292fb0a;hpb=3f18a1c4060aab4bc63c84fc805dc15a5ba6de9e;p=mirror%2Fdsa-puppet.git diff --git a/modules/puppetmaster/lib/puppet/parser/functions/ldapinfo.rb b/modules/puppetmaster/lib/puppet/parser/functions/ldapinfo.rb index 3a687224d..489970e63 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/ldapinfo.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/ldapinfo.rb @@ -14,11 +14,6 @@ module Puppet::Parser::Functions filter = '(hostname=' + host + ')' begin ldap.search2('ou=hosts,dc=debian,dc=org', LDAP::LDAP_SCOPE_SUBTREE, filter, attrs=attributes, false, 0, 0, s_attr="hostname").each do |x| - # 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 - unless attributes.include?("*") - next if attributes.any?{ |a| not x[a] or x[a].empty? } - end results[x['hostname'][0]] = x end rescue LDAP::ResultError