From: Stephen Gran Date: Sat, 14 Nov 2009 19:17:30 +0000 (+0000) Subject: Idiot. LDAP returns an array for all attributes, index into it for hash keys X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=13ea760c33a9f907cadda793626669ba0c91e27c;p=mirror%2Fdsa-puppet.git Idiot. LDAP returns an array for all attributes, index into it for hash keys 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 c65351f35..3564de329 100644 --- a/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb +++ b/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb @@ -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"