Idiot. LDAP returns an array for all attributes, index into it for hash keys
[mirror/dsa-puppet.git] / files / etc / puppet / lib / puppet / parser / functions / ldapinfo.rb
index c65351f..3564de3 100644 (file)
@@ -19,8 +19,8 @@ module Puppet::Parser::Functions
         unless attributes.include?("*")
           next if attributes.any?{ |a|  not x[a] or x[a].empty? }
         end
-        results[x['hostname']] = []
-        results[x['hostname']] << x
+        results[x['hostname'][0]] = []
+        results[x['hostname'][0]] << x
       end
     rescue LDAP::ResultError
       raise Puppet::ParseError, "LDAP error"