summaryrefslogtreecommitdiff
path: root/lib/chef/policy_builder
diff options
context:
space:
mode:
authordanielsdeleo <dan@chef.io>2015-09-15 11:23:06 -0700
committerdanielsdeleo <dan@chef.io>2015-09-17 14:29:50 -0700
commit90075c9d83c2df2916fd1a2d441401e1c7cf5362 (patch)
tree686f2d1ee887bc3e50e00ea279fa1cd7b4a16ec3 /lib/chef/policy_builder
parent460a7ec5347891d6615b7f88944cbd76998769b1 (diff)
downloadchef-90075c9d83c2df2916fd1a2d441401e1c7cf5362.tar.gz
Detect when user wants policyfile compat mode
Diffstat (limited to 'lib/chef/policy_builder')
-rw-r--r--lib/chef/policy_builder/dynamic.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/chef/policy_builder/dynamic.rb b/lib/chef/policy_builder/dynamic.rb
index d2849dd4f1..0f266a25fb 100644
--- a/lib/chef/policy_builder/dynamic.rb
+++ b/lib/chef/policy_builder/dynamic.rb
@@ -112,7 +112,10 @@ class Chef
end
def select_implementation(node)
- if policyfile_set_in_config? || policyfile_attribs_in_node_json? || node_has_policyfile_attrs?(node)
+ if policyfile_set_in_config? ||
+ policyfile_attribs_in_node_json? ||
+ node_has_policyfile_attrs?(node) ||
+ policyfile_compat_mode_config?
@implementation = Policyfile.new(node_name, ohai_data, json_attribs, override_runlist, events)
else
@implementation = ExpandNodeObject.new(node_name, ohai_data, json_attribs, override_runlist, events)
@@ -137,6 +140,10 @@ class Chef
config[:use_policyfile] || config[:policy_name] || config[:policy_group]
end
+ def policyfile_compat_mode_config?
+ config[:deployment_group] && !config[:policy_document_native_api]
+ end
+
end
end
end