lib/chef-irc-snitch.rb in chef-irc-snitch-0.0.3 vs lib/chef-irc-snitch.rb in chef-irc-snitch-0.0.4

- old
+ new

@@ -32,21 +32,20 @@ "token" => @github_token, "description" => "Chef run failed on #{node.name} @ #{Time.now.getutc}", "public" => false }) gist_id = JSON.parse(res.body)["gists"].first["repo"] + Chef::Log.info("Created a GitHub Gist @ https://gist.github.com/#{gist_id}") end rescue Timeout::Error Chef::Log.error("Timed out while attempting to create a GitHub Gist, retrying ...") max_attempts -= 1 retry if max_attempts > 0 end - Chef::Log.info("Created a GitHub Gist @ https://gist.github.com/#{gist_id}") - max_attempts = 2 ip_address = (node.has_key? :ec2) ? node.ec2.public_ipv4 : node.ipaddress - message = "Chef run failed on #{node.name} (#{ip_address}) : https://gist.github.com/#{gist_id}" + message = "Chef run failed on #{node.name} : #{ip_address} : #{node.roles.join(", ")} : https://gist.github.com/#{gist_id}" begin timeout(8) do ShoutBot.shout(@irc_uri, nil, @ssl) do |channel| channel.say message