From: Tomas Doran Date: Tue, 4 Sep 2012 16:04:35 +0000 (+0100) Subject: Fix error reporting for insane hostnames. X-Git-Tag: 0.3.0~14^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=0f1f35ff2307a048e2615dcf3750548462e20fdf;p=puppet-modules%2Fpuppetlabs-firewall.git Fix error reporting for insane hostnames. If you put some really silly values in (e.g. /) into hostnames then the error message s super super cryptic. This patch fixes that, so it's at least obvious what / where / why it's failing if you use --trace --debug --- diff --git a/lib/puppet/type/firewall.rb b/lib/puppet/type/firewall.rb index 942120b..e234685 100644 --- a/lib/puppet/type/firewall.rb +++ b/lib/puppet/type/firewall.rb @@ -97,7 +97,11 @@ Puppet::Type.newtype(:firewall) do EOS munge do |value| - @resource.host_to_ip(value) + begin + @resource.host_to_ip(value) + rescue Exception => e + self.fail("host_to_ip failed for #{value}, exception #{e}") + end end end