lib/cucumber/chef/helpers/chef_client.rb in cucumber-chef-2.0.1.pre vs lib/cucumber/chef/helpers/chef_client.rb in cucumber-chef-2.0.2.pre
- old
+ new
@@ -23,14 +23,17 @@
################################################################################
# call this in a Before hook
def chef_set_client_config(config={})
- @chef_client_config = { :log_level => :debug,
- :log_location => "/var/log/chef/client.log",
- :chef_server_url => "https://api.opscode.com/organizations/#{config[:orgname]}",
- :validation_client_name => "#{config[:orgname]}-validator" }.merge(config)
+ @chef_client_config = (@chef_client_config || {
+ :environment => "_default",
+ :log_level => :debug,
+ :log_location => "/var/log/chef/client.log",
+ :chef_server_url => "https://api.opscode.com/organizations/#{config[:orgname]}",
+ :validation_client_name => "#{config[:orgname]}-validator"
+ }).merge(config)
end
################################################################################
# call this before chef_run_client
@@ -61,9 +64,10 @@
f.puts("log_location \"#{@chef_client_config[:log_location]}\"")
f.puts("chef_server_url \"#{@chef_client_config[:chef_server_url]}\"")
f.puts("ssl_verify_mode :verify_none")
f.puts("validation_client_name \"#{@chef_client_config[:validation_client_name]}\"")
f.puts("node_name \"#{name}\"")
+ f.puts("environment \"#{@chef_client_config[:environment]}\"")
f.puts
f.puts("Mixlib::Log::Formatter.show_time = true")
end
attributes_json = File.join("/", container_root(name), "etc", "chef", "attributes.json")