From 3bdfa8f65cf19563e35d2bad3f7fcf9263ac7881 Mon Sep 17 00:00:00 2001 From: Evan Gilman Date: Wed, 2 Sep 2015 12:44:59 -0700 Subject: Consider only knife configuration for chef environment in bootstrap context Setting these values in Chef::Config is being deprecated in favor of using the knife config directly. https://github.com/chef/chef/issues/3946 --- lib/chef/knife/core/bootstrap_context.rb | 2 +- spec/unit/knife/core/bootstrap_context_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb index d210b9418f..8613a50cb4 100644 --- a/lib/chef/knife/core/bootstrap_context.rb +++ b/lib/chef/knife/core/bootstrap_context.rb @@ -40,7 +40,7 @@ class Chef end def bootstrap_environment - @chef_config[:environment] + @config[:environment] end def validation_key diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb index 0433ef9983..4d69d6300a 100644 --- a/spec/unit/knife/core/bootstrap_context_spec.rb +++ b/spec/unit/knife/core/bootstrap_context_spec.rb @@ -91,7 +91,7 @@ EXPECTED end describe "when bootstrapping into a specific environment" do - let(:chef_config){ {:environment => "prodtastic"} } + let(:config){ {:environment => "prodtastic"} } it "starts chef in the configured environment" do expect(bootstrap_context.start_chef).to eq('chef-client -j /etc/chef/first-boot.json -E prodtastic') end -- cgit v1.2.1