Skip to content

Commit ca6b085

Browse files
committed
Adding LOG_LEVEL env support, so you can get greater debugging from the chef client during feature runs
1 parent 2e544a4 commit ca6b085

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

features/steps/run_client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
# When
2121
###
2222
When /^I run the chef\-client$/ do
23+
log_level = ENV["LOG_LEVEL"] ? ENV["LOG_LEVEL"] : "error"
2324
status = Chef::Mixin::Command.popen4(
24-
"chef-client -c #{File.expand_path(File.join(File.dirname(__FILE__), '..', 'data', 'config', 'client.rb'))}", :waitlast => true) do |p, i, o, e|
25+
"chef-client -l #{log_level} -c #{File.expand_path(File.join(File.dirname(__FILE__), '..', 'data', 'config', 'client.rb'))}", :waitlast => true) do |p, i, o, e|
2526
i.close
2627
@stdout = o.gets(nil)
2728
@stderr = e.gets(nil)

0 commit comments

Comments
 (0)