summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorAndrew Shafer <andrew@reductivelabs.com>2008-10-06 22:06:39 -0600
committerJames Turnbull <james@lovedthanlost.net>2008-10-07 16:42:20 +1100
commitfb14e91226e494210c3b6c88d8553a745e4ac3ed (patch)
treef0a5e2df3894c7d8c3c9569573aeb886eeb87931 /lib/puppet
parent7275d7cb9083b4183f394a5d6798e1675def6d28 (diff)
downloadpuppet-fb14e91226e494210c3b6c88d8553a745e4ac3ed.tar.gz
puppet-fb14e91226e494210c3b6c88d8553a745e4ac3ed.tar.xz
puppet-fb14e91226e494210c3b6c88d8553a745e4ac3ed.zip
Fixed #1473 - Rescue Timeout::Error in xmlrpc clients
Added a rescue block for Timeout::Error (which isn't a subclass of StandardError) Removed a Dev Error conditional to facilitate testing
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/network/xmlrpc/client.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb
index 6d77286d3..c79f91d57 100644
--- a/lib/puppet/network/xmlrpc/client.rb
+++ b/lib/puppet/network/xmlrpc/client.rb
@@ -35,10 +35,6 @@ module Puppet::Network
interface.methods.each { |ary|
method = ary[0]
- if public_method_defined?(method)
- raise Puppet::DevError, "Method %s is already defined" %
- method
- end
newclient.send(:define_method,method) { |*args|
Puppet.debug "Calling %s.%s" % [namespace, method]
begin
@@ -74,6 +70,10 @@ module Puppet::Network
Puppet.warning "Other end went away; restarting connection and retrying"
self.recycle_connection
retry
+ rescue Timeout::Error => detail
+ Puppet.err "Connection timeout calling %s.%s: %s" %
+ [namespace, method, detail.to_s]
+ raise XMLRPCClientError.new("Connection Timeout").set_backtrace(detail.backtrace)
rescue => detail
if detail.message =~ /^Wrong size\. Was \d+, should be \d+$/
Puppet.warning "XMLRPC returned wrong size. Retrying."