diff options
author | Vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2019-10-23 10:55:43 +0530 |
---|---|---|
committer | Vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2020-01-22 10:50:38 +0530 |
commit | 1d7cc88faface3c2b50e50ab8d0f1700e7389320 (patch) | |
tree | d6e49b0b5822a9d23783889c5819d6cc0ddcdf51 /lib | |
parent | 9ae9a74ebc9f5f89203ab9cd98bb51393d4f9346 (diff) | |
download | chef-1d7cc88faface3c2b50e50ab8d0f1700e7389320.tar.gz |
raising exception for empty cookbooks instead of skipping
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/cookbook/cookbook_version_loader.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb index bed11d2ea7..7e09fae60c 100644 --- a/lib/chef/cookbook/cookbook_version_loader.rb +++ b/lib/chef/cookbook/cookbook_version_loader.rb @@ -83,9 +83,23 @@ class Chef def load Chef::Log.warn "load method is deprecated. Use load! instead" + metadata # force lazy evaluation to occur + + # re-raise any exception that occurred when reading the metadata + raise_metadata_error! + + load_all_files + + remove_ignored_files + + if empty? + raise Exceptions::CookbookNotFoundInRepo, "The directory #{cookbook_path} does not contain a cookbook" + end + + cookbook_settings end - alias :load_cookbooks :load! + alias :load_cookbooks :load def cookbook_version return nil if empty? |