attributes << 'hostname'
end
+ require 'ldap'
ldap = LDAP::SSLConn.new('db.debian.org', 636)
results = {}
unless attributes.include?("*")
next if attributes.any?{ |a| not x[a] or x[a].empty? }
end
- results[x['hostname']] = x
+ results[x['hostname'][0]] = x
end
rescue LDAP::ResultError
raise Puppet::ParseError, "LDAP error"
ensure
ldap.unbind
end
- return( host == '*' ? results : results[host] )
+ if host == '*'
+ return(results)
+ else
+ return(results[host])
+ end
end
end