Skip to content

Commit

Permalink
(#10722) Display errors on http report submission failures
Browse files Browse the repository at this point in the history
We were failing silently if the report submission to http
returned a non-200 response code.
  • Loading branch information
Nigel Kersten committed Nov 10, 2011
1 parent e29b5df commit 8b8f8d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/puppet/reports/http.rb
Expand Up @@ -16,7 +16,10 @@ def process
req.body = self.to_yaml
req.content_type = "application/x-yaml"
Net::HTTP.new(url.host, url.port).start {|http|
http.request(req)
response = http.request(req)
unless response.code == "200"
Puppet.err "Unable to submit report to #{Puppet[:reporturl].to_s} [#{response.code}] #{response.msg}"
end
}
end
end

0 comments on commit 8b8f8d7

Please sign in to comment.