]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
I think it's better to raise an exception and die rather than silently
authorStephen Gran <steve@lobefin.net>
Sun, 8 Nov 2009 14:51:34 +0000 (14:51 +0000)
committerStephen Gran <steve@lobefin.net>
Sun, 8 Nov 2009 14:51:34 +0000 (14:51 +0000)
continue on with no data.  We'll do that by raising a puppet parse error
exception, which will make the client log the problem.
Signed-off-by: Stephen Gran <steve@lobefin.net>
files/etc/puppet/lib/puppet/parser/functions/allnodeinfo.rb
files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb

index 4e6a6652b7910ac7dd664de875f3f54ca8e60cde..4270343b1eee418f1d94148be36eaf6c5272de49 100644 (file)
@@ -14,7 +14,9 @@ module Puppet::Parser::Functions
         results << x
       end
     rescue LDAP::ResultError
+      raise Puppet::ParseError, "LDAP error"
     rescue RuntimeError
+      raise Puppet::ParseError, "No data returned from search"
     ensure
       ldap.unbind
     end
index 11d3e7dd2c0157a32e38c96e3ee72d9f9a6f8370..d7f3daea7c41e872c23d81188f4ecbef22a88195 100644 (file)
@@ -53,7 +53,9 @@ module Puppet::Parser::Functions
         results['ldap'] << x
       end
     rescue LDAP::ResultError
+      raise Puppet::ParseError, "LDAP error"
     rescue RuntimeError
+      raise Puppet::ParseError, "No data returned from search"
     ensure
       ldap.unbind
     end