summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2017-04-28 16:20:59 +0100
committerThom May <thom@chef.io>2017-07-05 15:33:24 +0100
commit14ea525805d7948d1ade3234d33bcc9408953b30 (patch)
treed2a47f12135316faf1809ba3d6fa66293c4290bc
parent71863634ac50dbfb2601de536828b779517066ae (diff)
downloadchef-14ea525805d7948d1ade3234d33bcc9408953b30.tar.gz
If we don't have a run_list, don't send ittm/fix-policy-bootstrap
This should help bootstrapping with policies Fixes: #5353 Signed-off-by: Thom May <thom@chef.io>
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb1
-rw-r--r--spec/unit/knife/bootstrap_spec.rb4
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index c395ebcfa0..9b16b94910 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -223,6 +223,7 @@ validation_client_name "#{@chef_config[:validation_client_name]}"
attributes[:run_list] = @run_list
end
+ attributes.delete(:run_list) if attributes[:policy_name] && !attributes[:policy_name].empty?
attributes.merge!(:tags => @config[:tags]) if @config[:tags] && !@config[:tags].empty?
end
end
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index 4201963b7d..736ff9b099 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -586,6 +586,10 @@ describe Chef::Knife::Bootstrap do
expect(knife.bootstrap_context.first_boot).to have_key(:policy_group)
end
+ it "ensures that run_list is not set in the bootstrap context" do
+ expect(knife.bootstrap_context.first_boot).to_not have_key(:run_list)
+ end
+
end
# https://github.com/chef/chef/issues/4131