1 # DO NOT EDIT - This file is being maintained by Chef
8 class Email < Chef::Handler
11 def initialize(config={})
13 @config[:from] ||= "root@openstreetmap.org"
18 if failed? and not exception.is_a? SystemExit
19 subject = "Chef run failed on #{node.name}"
20 message = "#{run_status.formatted_exception}\n"
21 elsif elapsed_time > 300
22 subject = "Chef run took #{elapsed_time} on #{node.name}"
27 message << Array(backtrace).join("\n")
29 Pony.mail(:to => @config[:to], :from => @config[:from],
30 :subject => subject, :body => message, :via => :smtp)