summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2010-10-17 16:06:50 +0200
committerJames Turnbull <james@lovedthanlost.net>2010-11-10 11:52:01 +1100
commitcb16d3dcbad47e832890fe869e3d4f9c7224434c (patch)
tree9a987155545bc8b39b8cf04cebfbd115e3b1ee18
parent1d267425053784bd91d99187f85884ea61605cdf (diff)
downloadpuppet-cb16d3dcbad47e832890fe869e3d4f9c7224434c.tar.gz
puppet-cb16d3dcbad47e832890fe869e3d4f9c7224434c.tar.xz
puppet-cb16d3dcbad47e832890fe869e3d4f9c7224434c.zip
Puppet-load: better and safer error reporting
In case of connection, dns or timeout error, puppet-load would not report the error correctly or could crash. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
-rw-r--r--ext/puppet-load.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/puppet-load.rb b/ext/puppet-load.rb
index 24437c10b..35bee6ef8 100644
--- a/ext/puppet-load.rb
+++ b/ext/puppet-load.rb
@@ -265,6 +265,8 @@ class RequestPool
end
def spawn_request(index)
+ @times[index] = Time.now
+ @sizes[index] = 0
nodeidx = index % $options[:node].size
node = $options[:node][nodeidx]
EventMachine::HttpRequest.new("https://#{$options[:server]}:#{$options[:masterport]}/production/catalog/#{node}").get(
@@ -302,7 +304,7 @@ class RequestPool
}
conn.errback {
- Puppet.debug("Client #{index} finished with an error: #{conn.response.error}")
+ Puppet.debug("Client #{index} finished with an error: #{conn.error}")
@times[index] = Time.now - @times[index]
@responses[:failed].push(conn)
check_progress