lib/chef-irc-snitch.rb in chef-irc-snitch-0.0.4 vs lib/chef-irc-snitch.rb in chef-irc-snitch-0.0.5
- old
+ new
@@ -2,11 +2,11 @@
require 'chef'
require 'chef/handler'
require 'net/http'
require 'uri'
require 'json'
-require 'shout-bot'
+require 'carrier-pigeon'
class IRCSnitch < Chef::Handler
def initialize(irc_uri, github_user, github_token, ssl = false)
@irc_uri = irc_uri
@@ -46,13 +46,11 @@
ip_address = (node.has_key? :ec2) ? node.ec2.public_ipv4 : node.ipaddress
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
- Chef::Log.info("Informed chefs via IRC : #{message}")
- end
+ CarrierPigeon.send({:uri => @irc_uri, :message => message, :ssl => @ssl})
+ Chef::Log.info("Informed chefs via IRC : #{message}")
end
rescue Timeout::Error
Chef::Log.error("Timed out while attempting to message Chefs via IRC, retrying ...")
max_attempts -= 1
retry if max_attempts > 0