]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
Some more fixes. Sigh, some day I'll learn ruby
authorStephen Gran <steve@lobefin.net>
Sat, 14 Nov 2009 19:09:47 +0000 (19:09 +0000)
committerStephen Gran <steve@lobefin.net>
Sat, 14 Nov 2009 19:09:47 +0000 (19:09 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb

index b8080909c3c13e86163f41b3830729a68ffc0c32..c65351f3596064b76bb768c8be0133645d7b68c6 100644 (file)
@@ -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"