lib/cucumber/chef/helpers/chef_client.rb in cucumber-chef-2.1.0.rc.4 vs lib/cucumber/chef/helpers/chef_client.rb in cucumber-chef-2.1.0.rc.5
- old
+ new
@@ -60,15 +60,18 @@
logger.info { "Running chef client on container '#{name}'." }
arguments = {
"--node-name" => name,
"--json-attributes" => File.join("/etc", "chef", "attributes.json").to_s,
- "--log_level" => (ENV['LOG_LEVEL'] || "INFO").downcase
+ "--log_level" => @chef_client_config[:log_level],
+ "--logfile" => @chef_client_config[:log_location],
+ "--server" => @chef_client_config[:chef_server_url],
+ "--environment" => @chef_client_config[:environment]
}.reject{ |k,v| v.nil? }.sort
output = nil
bm = ::Benchmark.realtime do
- output = command_run_chroot(name, ["/usr/bin/chef-client", arguments, args].flatten.join(" "))
+ output = command_run_chroot(name, ["/usr/bin/chef-client", arguments, args, "--once"].flatten.join(" "))
end
logger.info { "Chef client run on container '#{name}' took %0.4f seconds." % bm }
output
end