summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2017-07-11 13:07:18 +0100
committerGitHub <noreply@github.com>2017-07-11 13:07:18 +0100
commite43c128179923fa83a71eb1eb37b405a78e2b33a (patch)
tree659d55c2e5dfd498a1b8d52e4cafc664a923886b
parent7888fa95badc3b73fb87d54fb6725eaaa8baefd8 (diff)
parent14ea525805d7948d1ade3234d33bcc9408953b30 (diff)
downloadchef-e43c128179923fa83a71eb1eb37b405a78e2b33a.tar.gz
Merge pull request #6102 from chef/tm/fix-policy-bootstrap
If we don't have a run_list, don't send it
-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