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 from_address = @config[:from]
18 to_address = @config[:to]
20 if failed? && !exception.is_a?(SystemExit)
21 message_subject = "Chef run failed on #{node.name}"
22 message_body = "#{run_status.formatted_exception}\n"
23 elsif elapsed_time > 600
24 message_subject = "Chef run took #{elapsed_time} on #{node.name}"
28 return unless message_subject
30 message_body << Array(backtrace).join("\n")
37 subject message_subject