1 # DO NOT EDIT - This file is being maintained by Chef
7 class Email < Chef::Handler
10 def initialize(config = {})
12 @config[:from] ||= "root@openstreetmap.org"
17 if failed? && !exception.is_a?(SystemExit)
18 subject = "Chef run failed on #{node.name}"
19 message = "#{run_status.formatted_exception}\n"
20 elsif elapsed_time > 600
21 subject = "Chef run took #{elapsed_time} on #{node.name}"
27 message << Array(backtrace).join("\n")
31 Pony.mail(:to => @config[:to], :from => @config[:from],
32 :subject => subject, :body => message, :via => :smtp)