From: Tom Hughes Date: Thu, 2 Aug 2018 21:12:36 +0000 (+0100) Subject: Delete any existing report handler before installing a new one X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/ac83022b37221af78f5ac2b9f9052e5a7791ee90?ds=sidebyside Delete any existing report handler before installing a new one --- diff --git a/cookbooks/chef/templates/default/client.rb.erb b/cookbooks/chef/templates/default/client.rb.erb index 65bf700e8..2af462bf9 100644 --- a/cookbooks/chef/templates/default/client.rb.erb +++ b/cookbooks/chef/templates/default/client.rb.erb @@ -39,5 +39,5 @@ email_handler = Chef::Handler::Email.new(:to => ["tom@compton.nu", "openstreetma # Configure report handlers -exception_handlers << email_handler -report_handlers << email_handler +exception_handlers.delete_if { |h| h.is_a?(Chef::Handler::Email) } << email_handler +report_handlers.delete_if { |h| h.is_a?(Chef::Handler::Email) } << email_handler