The previous maintenance patch for this file didn't provide as strong of
a guarantee of loading plugins as the code it replaced.
This patch restores the extremely broad exception catching, but prevents
mocha exceptions from being silently ignored.

Signed-off-by: Jesse Wolfe <[email protected]>
---
 lib/puppet/configurer/plugin_handler.rb     |    2 +-
 spec/unit/configurer/plugin_handler_spec.rb |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/lib/puppet/configurer/plugin_handler.rb 
b/lib/puppet/configurer/plugin_handler.rb
index 8192d47..cfc6b5a 100644
--- a/lib/puppet/configurer/plugin_handler.rb
+++ b/lib/puppet/configurer/plugin_handler.rb
@@ -19,7 +19,7 @@ module Puppet::Configurer::PluginHandler
     begin
       Puppet.info "Loading downloaded plugin #{file}"
       load file
-    rescue StandardError, LoadError => detail
+    rescue Exception => detail
       Puppet.err "Could not load downloaded file #{file}: #{detail}"
     end
   end
diff --git a/spec/unit/configurer/plugin_handler_spec.rb 
b/spec/unit/configurer/plugin_handler_spec.rb
index 1423ae4..30b135e 100755
--- a/spec/unit/configurer/plugin_handler_spec.rb
+++ b/spec/unit/configurer/plugin_handler_spec.rb
@@ -11,6 +11,10 @@ end
 describe Puppet::Configurer::PluginHandler do
   before do
     @pluginhandler = PluginHandlerTester.new
+
+    # PluginHandler#load_plugin has an extra-strong rescue clause
+    # this mock is to make sure that we don't silently ignore errors
+    Puppet.expects(:err).never
   end
 
   it "should have a method for downloading plugins" do
-- 
1.7.0.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to