]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
skip entries that don't have all the attributes we're searching for
authorStephen Gran <steve@lobefin.net>
Sun, 8 Nov 2009 19:01:11 +0000 (19:01 +0000)
committerStephen Gran <steve@lobefin.net>
Sun, 8 Nov 2009 19:01:11 +0000 (19:01 +0000)
Signed-off-by: Stephen Gran <steve@lobefin.net>
files/etc/puppet/lib/puppet/parser/functions/allnodeinfo.rb

index 4270343b1eee418f1d94148be36eaf6c5272de49..3eab872d10187862f8d946d19cb6fdebf88eed50 100644 (file)
@@ -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