diff options
author | John Keiser <john@johnkeiser.com> | 2015-12-11 11:53:24 -0800 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-12-15 13:01:32 -0800 |
commit | deefee3fda85fff400e38e62d7e70fc4e1aee86d (patch) | |
tree | cf0eabbdcbf54d1df9cbcca099f5cbbcefeeeb21 | |
parent | 9dbe7491927ecf73d5757179dc6e26c1946f46c0 (diff) | |
download | chef-deefee3fda85fff400e38e62d7e70fc4e1aee86d.tar.gz |
Don't feed policies to older versions of chef-zero
-rw-r--r-- | lib/chef/chef_fs/chef_fs_data_store.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/chef/chef_fs/chef_fs_data_store.rb b/lib/chef/chef_fs/chef_fs_data_store.rb index fef8b1df77..f886cd8c9a 100644 --- a/lib/chef/chef_fs/chef_fs_data_store.rb +++ b/lib/chef/chef_fs/chef_fs_data_store.rb @@ -443,7 +443,7 @@ class Chef end else - with_entry(path) do |entry| + result = with_entry(path) do |entry| begin entry.children.map { |c| zero_filename(c) }.sort rescue Chef::ChefFS::FileSystem::NotFoundError => e @@ -455,6 +455,13 @@ class Chef end end end + + # Older versions of chef-zero do not understand policies and cookbook_artifacts, + # don't give that stuff to them + if path == [] && ChefZero::VERSION.to_f < 4.4 + result.reject! { |child| %w(policies policy_data cookbook_artifacts).include?(child) } + end + result end end |