From 13ea760c33a9f907cadda793626669ba0c91e27c Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sat, 14 Nov 2009 19:17:30 +0000 Subject: [PATCH] Idiot. LDAP returns an array for all attributes, index into it for hash keys Signed-off-by: Stephen Gran --- files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb b/files/etc/puppet/lib/puppet/parser/functions/ldapinfo.rb index c65351f3..3564de32 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" -- 2.39.2