Skip to content

Commit

Permalink
Closes-Bug: #1524192
Browse files Browse the repository at this point in the history
Issue:
Reports were not handling the case where puppet run exits as a result of
puppet exiting on restart of target.

Fix:
Handled that case also the hostname was corrected.

Testing:
Made sure only valid puppet failures are reported.
and reboot cases are not reported as failures.

Change-Id: Idc8fa87f39212612e2284954f84eb48fc034e50b
  • Loading branch information
thilakrajs committed Dec 14, 2015
1 parent cb56821 commit 588e8b9
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -38,6 +38,10 @@ def process
puts "Catalog for server not found."
return
end
if msg.include? "Caught TERM; calling stop"
puts "Puppet agent exited"
return
end
log_data += resource + ":" + msg + "\n"
end
File.open(destination,"w") do |f|
Expand All @@ -48,10 +52,11 @@ def process
puts "puppet run failed"
client_fqdn = client.split(".")
client_hostname = client_fqdn[0]
print "log data =" + log_data +"\n"

http = Net::HTTP.new(hostname, 9002)

response = http.send_request('PUT', '/server_status?server_id=' + hostname + '&state=puppet_failed')
response = http.send_request('PUT', '/server_status?server_id=' + client_hostname + '&state=puppet_failed')
puts "response code is " + response.code
if response.code != "200"
puts "Error posting puppet status"
Expand Down

0 comments on commit 588e8b9

Please sign in to comment.