diff options
author | Tim Smith <tsmith@chef.io> | 2018-11-09 18:42:36 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-09 18:42:36 -0800 |
commit | 91b54ba5f3fbd949c9c1ecb898aca50b2076f960 (patch) | |
tree | b63940da1c9776a1846671ebc3d1f2df7fa0f9cb | |
parent | 657c3b613bf5cc911c9395a50a12a1ad32cbeab2 (diff) | |
parent | c63e4054403bca1ebb162313558ae5d70e6168f6 (diff) | |
download | chef-91b54ba5f3fbd949c9c1ecb898aca50b2076f960.tar.gz |
Merge pull request #7910 from chef/policy_files_always
Always run policy_file if a policy_file or policy_group exists
-rw-r--r-- | chef-config/lib/chef-config/config.rb | 6 | ||||
-rw-r--r-- | lib/chef/policy_builder/dynamic.rb | 2 | ||||
-rw-r--r-- | spec/unit/policy_builder/dynamic_spec.rb | 12 |
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 |