From: Peter Palfrader Date: Wed, 2 Mar 2011 20:41:13 +0000 (+0100) Subject: A better try/except around nodeinfo X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=12a1f2a700e3dca640d92f992f50a966a347f247;p=mirror%2Fdsa-puppet.git A better try/except around nodeinfo --- diff --git a/modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb b/modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb index 5eb6c97bb..957af7429 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb @@ -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