[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1613-ga91c476

James Turnbull james at lovedthanlost.net
Mon Jan 25 05:48:55 UTC 2010


The following commit has been merged in the upstream branch:
commit a91c476387887baa5920f5539a7c4acfaf8cecd9
Author: Markus Roberts <Markus at reality.com>
Date:   Thu Jan 21 16:03:26 2010 -0800

    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.

diff --git a/lib/puppet/agent.rb b/lib/puppet/agent.rb
index 7896605..5dbb152 100644
--- a/lib/puppet/agent.rb
+++ b/lib/puppet/agent.rb
@@ -51,6 +51,8 @@ class Puppet::Agent
         with_client do |client|
             begin
                 sync.synchronize { lock { client.run(*args) } }
+            rescue SystemExit,NoMemoryError,SignalException,Interrupt
+                raise
             rescue Exception => detail
                 puts detail.backtrace if Puppet[:trace]
                 Puppet.err "Could not run %s: %s" % [client_class, detail]
@@ -122,6 +124,8 @@ class Puppet::Agent
     def with_client
         begin
             @client = client_class.new
+        rescue SystemExit,NoMemoryError,SignalException,Interrupt
+            raise
         rescue Exception => detail
             puts detail.backtrace if Puppet[:trace]
             Puppet.err "Could not create instance of %s: %s" % [client_class, detail]
diff --git a/lib/puppet/configurer.rb b/lib/puppet/configurer.rb
index ec61272..56217d6 100644
--- a/lib/puppet/configurer.rb
+++ b/lib/puppet/configurer.rb
@@ -105,6 +105,8 @@ class Puppet::Configurer
             duration = thinmark do
                 result = catalog_class.find(name, fact_options.merge(:ignore_cache => true))
             end
+        rescue SystemExit,NoMemoryError,SignalException,Interrupt
+            raise
         rescue Exception => detail
             puts detail.backtrace if Puppet[:trace]
             Puppet.err "Could not retrieve catalog from remote server: %s" % detail
@@ -148,6 +150,8 @@ class Puppet::Configurer
     def run(options = {})
         begin
             prepare()
+        rescue SystemExit,NoMemoryError,SignalException,Interrupt
+            raise
         rescue Exception => detail
             puts detail.backtrace if Puppet[:trace]
             Puppet.err "Failed to prepare catalog: %s" % detail
diff --git a/lib/puppet/configurer/fact_handler.rb b/lib/puppet/configurer/fact_handler.rb
index 40e79b6..a05d890 100644
--- a/lib/puppet/configurer/fact_handler.rb
+++ b/lib/puppet/configurer/fact_handler.rb
@@ -17,6 +17,8 @@ module Puppet::Configurer::FactHandler
         begin
             reload_facter()
             Puppet::Node::Facts.find(Puppet[:certname])
+        rescue SystemExit,NoMemoryError,SignalException,Interrupt
+            raise
         rescue Exception => detail
             puts detail.backtrace if Puppet[:trace]
             raise Puppet::Error, "Could not retrieve local facts: %s" % detail
diff --git a/lib/puppet/configurer/plugin_handler.rb b/lib/puppet/configurer/plugin_handler.rb
index e934f58..8569421 100644
--- a/lib/puppet/configurer/plugin_handler.rb
+++ b/lib/puppet/configurer/plugin_handler.rb
@@ -19,6 +19,8 @@ module Puppet::Configurer::PluginHandler
         begin
             Puppet.info "Loading downloaded plugin %s" % file
             load file
+        rescue SystemExit,NoMemoryError,SignalException,Interrupt
+            raise
         rescue Exception => detail
             Puppet.err "Could not load downloaded file %s: %s" % [file, detail]
         end
diff --git a/lib/puppet/indirector/facts/facter.rb b/lib/puppet/indirector/facts/facter.rb
index 6c6cbc6..2caeeed 100644
--- a/lib/puppet/indirector/facts/facter.rb
+++ b/lib/puppet/indirector/facts/facter.rb
@@ -29,6 +29,8 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
                     Timeout::timeout(self.timeout) do
                         load file
                     end
+                rescue SystemExit,NoMemoryError,SignalException,Interrupt
+                    raise
                 rescue Exception => detail
                     Puppet.warning "Could not load fact file %s: %s" % [fqfile, detail]
                 end
diff --git a/lib/puppet/indirector/ldap.rb b/lib/puppet/indirector/ldap.rb
index 51bab0e..31ee0e0 100644
--- a/lib/puppet/indirector/ldap.rb
+++ b/lib/puppet/indirector/ldap.rb
@@ -40,6 +40,8 @@ class Puppet::Indirector::Ldap < Puppet::Indirector::Terminus
                 found = true
                 yield entry
             end
+        rescue SystemExit,NoMemoryError,SignalException,Interrupt
+            raise
         rescue Exception => detail
             if count == 0
                 # Try reconnecting to ldap if we get an exception and we haven't yet retried.
diff --git a/lib/puppet/network/http/handler.rb b/lib/puppet/network/http/handler.rb
index 65bb0f8..4d9634f 100644
--- a/lib/puppet/network/http/handler.rb
+++ b/lib/puppet/network/http/handler.rb
@@ -66,6 +66,8 @@ module Puppet::Network::HTTP::Handler
         check_authorization(indirection_request)
 
         send("do_%s" % indirection_request.method, indirection_request, request, response)
+    rescue SystemExit,NoMemoryError,SignalException,Interrupt
+        raise
     rescue Exception => e
         return do_exception(response, e)
     end
diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb
index ee2c008..805d993 100644
--- a/lib/puppet/network/xmlrpc/client.rb
+++ b/lib/puppet/network/xmlrpc/client.rb
@@ -144,6 +144,8 @@ module Puppet::Network
             Puppet.debug "Calling %s.%s" % [namespace, method]
             begin
                 call("%s.%s" % [namespace, method.to_s],*args)
+            rescue SystemExit,NoMemoryError,SignalException,Interrupt
+                raise
             rescue Exception => detail
                 retry if self.class.error_handler(detail).execute(self, detail, namespace, method) == :retry
             end
diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
index a645fbe..748c84e 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
diff --git a/lib/puppet/ssl/host.rb b/lib/puppet/ssl/host.rb
index 75e51e5..d6bbc4e 100644
--- a/lib/puppet/ssl/host.rb
+++ b/lib/puppet/ssl/host.rb
@@ -220,6 +220,8 @@ class Puppet::SSL::Host
             return if certificate
             generate
             return if certificate
+        rescue SystemExit,NoMemoryError,SignalException,Interrupt
+            raise
         rescue Exception => detail
             Puppet.err "Could not request certificate: %s" % detail.to_s
             if time < 1
diff --git a/lib/puppet/util/autoload.rb b/lib/puppet/util/autoload.rb
index ec2f48c..142ff29 100644
--- a/lib/puppet/util/autoload.rb
+++ b/lib/puppet/util/autoload.rb
@@ -86,6 +86,8 @@ class Puppet::Util::Autoload
                 name = symbolize(name)
                 loaded name, file
                 return true
+            rescue SystemExit,NoMemoryError,SignalException,Interrupt
+                raise
             rescue Exception => detail
                 # I have no idea what's going on here, but different versions
                 # of ruby are raising different errors on missing files.
@@ -123,6 +125,8 @@ class Puppet::Util::Autoload
                 begin
                     Kernel.require file
                     loaded(name, file)
+                rescue SystemExit,NoMemoryError,SignalException,Interrupt
+                    raise
                 rescue Exception => detail
                     if Puppet[:trace]
                         puts detail.backtrace
diff --git a/lib/puppet/util/feature.rb b/lib/puppet/util/feature.rb
index add1b26..8f77a27 100644
--- a/lib/puppet/util/feature.rb
+++ b/lib/puppet/util/feature.rb
@@ -83,6 +83,8 @@ class Puppet::Util::Feature
 
         begin
             require lib
+        rescue SystemExit,NoMemoryError,SignalException,Interrupt
+            raise
         rescue Exception
             Puppet.debug "Failed to load library '%s' for feature '%s'" % [lib, name]
             return false

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list