diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-16 15:23:58 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-02-16 15:23:58 -0800 |
commit | d4a4f181c32310043e9279cdf11d37013e89e9ca (patch) | |
tree | e859bf99e3f2b94f164e3d965c1d99f7eb046c7c /lib | |
parent | 5959add42e911e14918c41d0212f6ba8e0425d11 (diff) | |
download | chef-d4a4f181c32310043e9279cdf11d37013e89e9ca.tar.gz |
don't warn about shadow cookbooks twice
knife cookbook upload already warns once
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/cookbook_loader.rb | 12 | ||||
-rw-r--r-- | lib/chef/knife/cookbook_upload.rb | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/chef/cookbook_loader.rb b/lib/chef/cookbook_loader.rb index c0fd515bf2..6b80fbd662 100644 --- a/lib/chef/cookbook_loader.rb +++ b/lib/chef/cookbook_loader.rb @@ -73,15 +73,23 @@ class Chef end end - def load_cookbooks + # Will be removed when cookbook shadowing is removed, do NOT create new consumers of this API. + # + # @api private + def load_cookbooks_without_shadow_warning preload_cookbooks @loaders_by_name.each do |cookbook_name, _loaders| load_cookbook(cookbook_name) end - warn_about_cookbook_shadowing @cookbooks_by_name end + def load_cookbooks + ret = load_cookbooks_without_shadow_warning + warn_about_cookbook_shadowing + ret + end + def load_cookbook(cookbook_name) preload_cookbooks diff --git a/lib/chef/knife/cookbook_upload.rb b/lib/chef/knife/cookbook_upload.rb index e16e21ae64..f1e27fb8ac 100644 --- a/lib/chef/knife/cookbook_upload.rb +++ b/lib/chef/knife/cookbook_upload.rb @@ -103,7 +103,7 @@ class Chef @server_side_cookbooks = Chef::CookbookVersion.list_all_versions justify_width = @server_side_cookbooks.map { |name| name.size }.max.to_i + 2 if config[:all] - cookbook_repo.load_cookbooks + cookbook_repo.load_cookbooks_without_shadow_warning cookbooks_for_upload = [] cookbook_repo.each do |cookbook_name, cookbook| cookbooks_for_upload << cookbook @@ -166,7 +166,7 @@ class Chef def cookbooks_to_upload @cookbooks_to_upload ||= if config[:all] - cookbook_repo.load_cookbooks + cookbook_repo.load_cookbooks_without_shadow_warning else upload_set = {} @name_args.each do |cookbook_name| |