From d33aa87255d079a9744b22ecfec0241a84ba79b0 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sun, 8 Nov 2009 19:01:11 +0000 Subject: [PATCH] skip entries that don't have all the attributes we're searching for Signed-off-by: Stephen Gran --- files/etc/puppet/lib/puppet/parser/functions/allnodeinfo.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/files/etc/puppet/lib/puppet/parser/functions/allnodeinfo.rb b/files/etc/puppet/lib/puppet/parser/functions/allnodeinfo.rb index 4270343b1..3eab872d1 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 -- 2.20.1