lib/chef/provisioning/transport.rb in chef-provisioning-1.0.1 vs lib/chef/provisioning/transport.rb in chef-provisioning-1.1.0
- old
+ new
@@ -65,21 +65,26 @@
def stream_chunk(options, stdout_chunk, stderr_chunk)
if options[:stream].is_a?(Proc)
options[:stream].call(stdout_chunk, stderr_chunk)
else
if stdout_chunk
- if options[:stream_stdout]
- options[:stream_stdout].print stdout_chunk
+ if options.has_key?(:stream_stdout)
+ stream = options[:stream_stdout]
elsif options[:stream] || config[:log_level] == :debug
- STDOUT.print stdout_chunk
+ stream = config[:stdout] || STDOUT
end
+
+ stream.print stdout_chunk if stream
end
+
if stderr_chunk
- if options[:stream_stderr]
- options[:stream_stderr].print stderr_chunk
+ if options.has_key?(:stream_stderr)
+ stream = options[:stream_stderr]
elsif options[:stream] || config[:log_level] == :debug
- STDERR.print stderr_chunk
+ stream = config[:stderr] || STDERR
end
+
+ stream.print stderr_chunk if stream
end
end
end
def with_execute_timeout(options, &block)