[chef] Re: Re: Re: Re: Re: Exception Handlers with ignore_failure


Chronological Thread 
  • From: jfotop < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Re: Exception Handlers with ignore_failure
  • Date: Tue, 4 Dec 2012 07:57:53 -0800 (PST)

From what I saw and understood, run_status.events could be one of:

node:  
exception:  
end_time:  
elapsed_time:  
all_resources:  
backtrace:  
success: true 
updated_resources:  
start_time:  

I could of misunderstood, but when trying to add run_status.events to the
report handler method into the message of the email i send, I get a method
error saying:
raised #<ArgumentError: wrong number of arguments (0 for 3)>
My handler code is:

def report
      # The Node is available as +node+
      subject = "Chef run failed on #{node.name} \n"
      # +run_status+ is a value object with all of the run status data
      message = "#{run_status.formatted_exception}\n
#{run_status.events.resource_failed}"
      # Join the backtrace lines. Coerce to an array just in case.
      message << Array(backtrace).join("\n")
      Pony.mail(:to => @to_address, :from => @from_address, :subject =>
subject, :body => message)
    end

Any ideas?



Archive powered by MHonArc 2.6.16.

§