From 12a1f2a700e3dca640d92f992f50a966a347f247 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Wed, 2 Mar 2011 21:41:13 +0100 Subject: [PATCH] A better try/except around nodeinfo --- .../puppetmaster/lib/puppet/parser/functions/nodeinfo.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.20.1