summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-12 12:56:39 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-12 12:56:39 -0800
commit8a92ca64c1b19c1c759ff2afd9fc9c1ae1a6b63c (patch)
tree3901d73bb541d8d9c587796431cc8eb491969bbd
parent1e324f073455db7596f37da6bf21b2f6521529ce (diff)
downloadchef-8a92ca64c1b19c1c759ff2afd9fc9c1ae1a6b63c.tar.gz
extend deprecation warnings more broadly
Cookbook shadowing has been deprecated since 2011 in Chef 0.10.4 https://github.com/chef/chef/commit/5a9fee8edaede311ac03a15d52fbc66dad83b576 That warning has only been emitted when using 'knife cookbook upload' (and only that command). This extends that deprecation warning more broadly into all consumers of Chef::CookbookLoader that have been using that feature.
-rw-r--r--lib/chef/cookbook_loader.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/chef/cookbook_loader.rb b/lib/chef/cookbook_loader.rb
index 9bab6f01ce..977c65211a 100644
--- a/lib/chef/cookbook_loader.rb
+++ b/lib/chef/cookbook_loader.rb
@@ -66,11 +66,19 @@ class Chef
merged_cookbook_paths
end
+ def warn_about_cookbook_shadowing
+ unless merged_cookbooks.empty?
+ Chef::Log.deprecation "The cookbooks: #{merged_cookbooks.join(', ')} exist in multiple places in your cookbook_path. " +
+ "A composite version has been compiled. In a future version of Chef this behavior will be removed."
+ end
+ end
+
def load_cookbooks
preload_cookbooks
@loaders_by_name.each do |cookbook_name, _loaders|
load_cookbook(cookbook_name)
end
+ warn_about_cookbook_shadowing
@cookbooks_by_name
end