]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
A better try/except around nodeinfo
authorPeter Palfrader <peter@palfrader.org>
Wed, 2 Mar 2011 20:41:13 +0000 (21:41 +0100)
committerPeter Palfrader <peter@palfrader.org>
Wed, 2 Mar 2011 20:41:13 +0000 (21:41 +0100)
modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb

index 5eb6c97bb7cc1baeb985f254c63ca5179c92e39b..957af7429191ba39b781c517454a419e4968cbf1 100644 (file)
@@ -1,8 +1,8 @@
 module Puppet::Parser::Functions
   newfunction(:nodeinfo, :type => :rvalue) do |args|
+    host = args[0]
+    yamlfile = args[1]
     begin
-      host = args[0]
-      yamlfile = args[1]
 
       require '/var/lib/puppet/lib/puppet/parser/functions/ldapinfo.rb'
       require '/var/lib/puppet/lib/puppet/parser/functions/whohosts.rb'
@@ -53,7 +53,7 @@ module Puppet::Parser::Functions
 
       return(nodeinfo)
     rescue => e
-      raise Puppet::ParseError, "Error while trying to match addr #{addr} for net #{net}: #{e.message}\n#{e.backtrace}"
+      raise Puppet::ParseError, "Error in nodeinfo for node #{host}, yamlfile #{yamlfile}"
     end
   end
 end