diff options
| author | Markus Roberts <Markus@reality.com> | 2010-01-21 16:03:26 -0800 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2010-01-24 07:29:49 +1100 |
| commit | a91c476387887baa5920f5539a7c4acfaf8cecd9 (patch) | |
| tree | f60946f17d929bf7037ec4dd5102e3e04878913a /lib/puppet/provider | |
| parent | 1a263e27dede28d3844a4f010ab6ce42ef2977b0 (diff) | |
| download | puppet-a91c476387887baa5920f5539a7c4acfaf8cecd9.tar.gz puppet-a91c476387887baa5920f5539a7c4acfaf8cecd9.tar.xz puppet-a91c476387887baa5920f5539a7c4acfaf8cecd9.zip | |
Fix for #3088 (catching Exception also traps SystemExit)
Changing rescues from the default to Exception (to catch errors that don't
descend from StandardError) had the unintended consequence of catching (and
suppressing) SystemExit.
This patch restores the behavior of by reraising the exception.
Of the other exceptions that fall through the same crack (NoMemoryError,
SignalException, LoadError, Interrupt, NotImplementedError, and ScriptError)
this patch also reraises NoMemoryError, SignalException, and Interrupt in the
same way and leaves the rest captured.
Diffstat (limited to 'lib/puppet/provider')
| -rw-r--r-- | lib/puppet/provider/augeas/augeas.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb index a645fbe8a..748c84e7d 100644 --- a/lib/puppet/provider/augeas/augeas.rb +++ b/lib/puppet/provider/augeas/augeas.rb @@ -254,6 +254,8 @@ Puppet::Type.type(:augeas).provide(:augeas) do when "get"; return_value = process_get(cmd_array) when "match"; return_value = process_match(cmd_array) end + rescue SystemExit,NoMemoryError,SignalException,Interrupt + raise rescue Exception => e fail("Error sending command '#{command}' with params #{cmd_array[1..-1].inspect}/#{e.message}") end @@ -335,6 +337,8 @@ Puppet::Type.type(:augeas).provide(:augeas) do aug.insert(path, label, before) else fail("Command '#{command}' is not supported") end + rescue SystemExit,NoMemoryError,SignalException,Interrupt + raise rescue Exception => e fail("Error sending command '#{command}' with params #{cmd_array.inspect}/#{e.message}") end |
