From: Stephen Gran Date: Sun, 8 Nov 2009 19:01:11 +0000 (+0000) Subject: skip entries that don't have all the attributes we're searching for X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d33aa87255d079a9744b22ecfec0241a84ba79b0;p=dsa-puppet.git skip entries that don't have all the attributes we're searching for Signed-off-by: Stephen Gran --- diff --git a/files/etc/puppet/lib/puppet/parser/functions/allnodeinfo.rb b/files/etc/puppet/lib/puppet/parser/functions/allnodeinfo.rb index 4270343b..3eab872d 100644 --- a/files/etc/puppet/lib/puppet/parser/functions/allnodeinfo.rb +++ b/files/etc/puppet/lib/puppet/parser/functions/allnodeinfo.rb @@ -11,6 +11,10 @@ module Puppet::Parser::Functions filter = '(hostname=*)' begin ldap.search2('ou=hosts,dc=debian,dc=org', LDAP::LDAP_SCOPE_SUBTREE, filter, attrs=attributes, false, 0, 0, s_attr="hostname") do |x| + # If a returned value doesn't have all the attributes we're searching for, skip + attributes.each do |a| + next if x[a].empty? + end results << x end rescue LDAP::ResultError