lib/isbumiawake/chef/handler.rb in isbumiawake-chef-0.1.3 vs lib/isbumiawake/chef/handler.rb in isbumiawake-chef-0.1.4
- old
+ new
@@ -1,24 +1,25 @@
require "net/http"
+require "open-uri"
require 'chef/handler'
module Isbumiawake
module Chef
class Handler < ::Chef::Handler
def initialize(args)
@url = args["url"]
end
def report
- Net::HTTP.post_form(self.url, :message => self.message).body
+ open(self.url)#, :message => self.message).body
end
def url
URI.parse(@url)
end
def message
- "Chef run on node #{node.fqdn} #{status} completed in #{elapsed_time} (#{start_time}-#{end_time}) and updated: #{updated_resources.join(",")}"
+ "Chef run on node #{node.fqdn} #{success? ? "successfully" : "NOT successfully"} completed in #{elapsed_time} (#{start_time}-#{end_time}) and updated: #{updated_resources.join(",")}"
end
end
end
end