diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2021-07-13 20:23:43 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2021-07-13 20:23:43 -0700 |
commit | a54a11eeffccf1f5e9c08cbc193d4606a7791189 (patch) | |
tree | bc9848b6aa272c4ff70bc78e54e58b66d30d6ec3 | |
parent | 31c051b79dc17bf4687e35ac12a824f608598ff1 (diff) | |
download | chef-a54a11eeffccf1f5e9c08cbc193d4606a7791189.tar.gz |
deprecate policyfile compat mode
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/deprecated.rb | 4 | ||||
-rw-r--r-- | lib/chef/policy_builder/policyfile.rb | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/chef/deprecated.rb b/lib/chef/deprecated.rb index 4960e03871..f41b3d5443 100644 --- a/lib/chef/deprecated.rb +++ b/lib/chef/deprecated.rb @@ -259,6 +259,10 @@ class Chef target 34 end + class PolicyfileCompatMode < Base + target 35 + end + class Generic < Base def url "https://docs.chef.io/chef_deprecations_client/" diff --git a/lib/chef/policy_builder/policyfile.rb b/lib/chef/policy_builder/policyfile.rb index 63d34a2afc..541db1a9b9 100644 --- a/lib/chef/policy_builder/policyfile.rb +++ b/lib/chef/policy_builder/policyfile.rb @@ -123,6 +123,11 @@ class Chef # consume_external_attrs may add items to the run_list. Save the # expanded run_list, which we will pass to the server later to # determine which versions of cookbooks to use. + + unless Chef::Config[:policy_document_native_api] + Chef::Log.deprecated(:policyfile_compat_mode, "The chef-server 11 policyfile compat mode is deprecated, please set policy_document_native_api to true in your config") + end + node.reset_defaults_and_overrides node.consume_external_attrs(ohai_data, json_attribs) |