From: Stephen Gran Date: Sat, 14 Nov 2009 19:09:47 +0000 (+0000) Subject: Some more fixes. Sigh, some day I'll learn ruby X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=b5fb19eb10dd9311ee1bb1af1d93753a895b219d;p=mirror%2Fdsa-puppet.git Some more fixes. Sigh, some day I'll learn ruby Signed-off-by: Stephen Gran --- 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"