Created
January 23, 2009 02:37
-
-
Save chef/50859 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
Timeout.timeout(Chef::Config[:run_command_stdout_timeout]) do | |
while stdout.ready? == nil | |
Chef::Log.debug("Waiting for STDOUT to be ready..") | |
sleep 1 | |
end | |
end | |
rescue Timeout::Error => e | |
Chef::Log.error("#{args[:command]} timed out reading STDOUT") | |
else | |
stdout_string = stdout.gets(nil) | |
if stdout_string | |
command_stdout = stdout_string | |
Chef::Log.debug("---- Begin #{args[:command]} STDOUT ----") | |
Chef::Log.debug(stdout_string.strip) | |
Chef::Log.debug("---- End #{args[:command]} STDOUT ----") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment