[chef] stdout/stderr and exception/report framework


Chronological Thread 
  • From: 2bjc 466 < >
  • To:
  • Subject: [chef] stdout/stderr and exception/report framework
  • Date: Mon, 9 Apr 2012 11:11:30 -0600

Hi list,

We have two issues with chef at the moment. The first is that we want to write execute resources that leverage rsync and be able to behave in different ways based on the stderr/stdout of the rsync command. It looks like chef is specifically written to discard stderr/stdout with the exception of console output, which isn't useful outside of debugging (provider/execute.rb):

  if STDOUT.tty? && !Chef::Config[:daemon] && Chef::Log.info?
    opts[:live_stream] = STDOUT
  end

The second is that we would like to use chef's exception/report framework that is available after throwing an exception, but without throwing an exception. Is there a way to trigger an exception that does not cause chef to fail, or a way to use the exception/report framework without throwing an exception? There are many cases where we want to be notified of changes on a chef client, but do not want chef to terminate.

Currently we are working on redefining the Chef::RunStatus class to give us stderr/stdout, and writing a custom execute resource to pipe the stderr/stdout. If there are ways to do this without modifying chef internals, let us know, as we would prefer to run a vanilla chef install.

Thanks!

Jesse



Archive powered by MHonArc 2.6.16.

§