lib/chef_metal/transport.rb in chef-metal-0.10.2 vs lib/chef_metal/transport.rb in chef-metal-0.11.beta
- old
+ new
@@ -45,27 +45,32 @@
def available?
raise "available? not overridden on #{self.class}"
end
+ # Config hash, including :log_level and :logger as keys
+ def config
+ raise "config not overridden on #{self.class}"
+ end
+
protected
# Helper to implement stdout/stderr streaming in execute
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
- elsif options[:stream] || Chef::Config.log_level == :debug
+ elsif options[:stream] || config[:log_level] == :debug
STDOUT.print stdout_chunk
end
end
if stderr_chunk
if options[:stream_stderr]
options[:stream_stderr].print stderr_chunk
- elsif options[:stream] || Chef::Config.log_level == :debug
+ elsif options[:stream] || config[:log_level] == :debug
STDERR.print stderr_chunk
end
end
end
end