From b5fb19eb10dd9311ee1bb1af1d93753a895b219d Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sat, 14 Nov 2009 19:09:47 +0000 Subject: [PATCH] Some more fixes. Sigh, some day I'll learn ruby Signed-off-by: Stephen Gran --- files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb b/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb index b8080909c..c65351f35 100644 --- a/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb +++ b/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb @@ -7,6 +7,7 @@ module Puppet::Parser::Functions attributes << 'hostname' end + require 'ldap' ldap = LDAP::SSLConn.new('db.debian.org', 636) results = {} @@ -18,7 +19,8 @@ module Puppet::Parser::Functions unless attributes.include?("*") next if attributes.any?{ |a| not x[a] or x[a].empty? } end - results[host] = x + results[x['hostname']] = [] + results[x['hostname']] << x end rescue LDAP::ResultError raise Puppet::ParseError, "LDAP error" -- 2.20.1