summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-11-09 16:28:05 -0800
committerTim Smith <tsmith@chef.io>2018-11-09 16:28:05 -0800
commitc63e4054403bca1ebb162313558ae5d70e6168f6 (patch)
tree2b08b996edd86b17f11f70f43e3d6251471dbc42
parentb161757e090d7b4e09bf240b8c89efd51a083d00 (diff)
downloadchef-c63e4054403bca1ebb162313558ae5d70e6168f6.tar.gz
Always run policy_file if a policy_file or policy_group existspolicy_files_always
Remove the config to turn it off Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--chef-config/lib/chef-config/config.rb6
-rw-r--r--lib/chef/policy_builder/dynamic.rb2
-rw-r--r--spec/unit/policy_builder/dynamic_spec.rb12
3 files changed, 1 insertions, 19 deletions
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb
index d0363c22c7..f4759e6c17 100644
--- a/chef-config/lib/chef-config/config.rb
+++ b/chef-config/lib/chef-config/config.rb
@@ -491,12 +491,6 @@ module ChefConfig
default :named_run_list, nil
- # During initial development, users were required to set `use_policyfile true`
- # in `client.rb` to opt-in to policyfile use. Chef Client now examines
- # configuration, node json, and the stored node to determine if policyfile
- # usage is desired. This flag is still honored if set, but is unnecessary.
- default :use_policyfile, false
-
# Policyfiles can be used in a native mode (default) or compatibility mode.
# Native mode requires Chef Server 12.1 (it can be enabled via feature flag
# on some prior versions). In native mode, policies and associated
diff --git a/lib/chef/policy_builder/dynamic.rb b/lib/chef/policy_builder/dynamic.rb
index 84021ea611..8ce4f25bfa 100644
--- a/lib/chef/policy_builder/dynamic.rb
+++ b/lib/chef/policy_builder/dynamic.rb
@@ -173,7 +173,7 @@ class Chef
end
def policyfile_set_in_config?
- config[:use_policyfile] || config[:policy_name] || config[:policy_group]
+ config[:policy_name] || config[:policy_group]
end
def policyfile_compat_mode_config?
diff --git a/spec/unit/policy_builder/dynamic_spec.rb b/spec/unit/policy_builder/dynamic_spec.rb
index d94b2a69a2..f014cd9f2e 100644
--- a/spec/unit/policy_builder/dynamic_spec.rb
+++ b/spec/unit/policy_builder/dynamic_spec.rb
@@ -131,18 +131,6 @@ describe Chef::PolicyBuilder::Dynamic do
end
- context "and :use_policyfile is set in Chef::Config" do
-
- before do
- Chef::Config[:use_policyfile] = true
- end
-
- it "uses the Policyfile implementation" do
- expect(implementation).to be_a(Chef::PolicyBuilder::Policyfile)
- end
-
- end
-
context "and policy_name and policy_group are set on Chef::Config" do
before do