]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/chef/templates/default/report.rb.erb
Use mail gem instead of pony
[chef.git] / cookbooks / chef / templates / default / report.rb.erb
index 0317f92865d54b69643a8ec7a6234e28109183c9..518ec13837734ef1d5ea998876479cda9b46e9e3 100644 (file)
@@ -17,7 +17,7 @@ class Chef
         if failed? && !exception.is_a?(SystemExit)
           subject = "Chef run failed on #{node.name}"
           message = "#{run_status.formatted_exception}\n"
-        elsif elapsed_time > 300
+        elsif elapsed_time > 600
           subject = "Chef run took #{elapsed_time} on #{node.name}"
           message = ""
         end
@@ -26,10 +26,14 @@ class Chef
 
         message << Array(backtrace).join("\n")
 
-        require "pony"
+        require "mail"
 
-        Pony.mail(:to => @config[:to], :from => @config[:from],
-                  :subject => subject, :body => message, :via => :smtp)
+        Mail.deliver do
+          to @config[:to]
+          from @config[:from]
+          subject subject
+          body message
+        end
       end
     end
   end