diff options
author | Vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2019-10-22 02:00:17 +0530 |
---|---|---|
committer | Vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2020-01-22 10:50:37 +0530 |
commit | 87645e71e0141f2409a9b06513e36878ba7164ef (patch) | |
tree | ba28dba32b322ec1d28c279e7e11d40175aab4c8 /lib/chef/cookbook | |
parent | 03257148dd5228049084258f0c4d926f9c5d28ee (diff) | |
download | chef-87645e71e0141f2409a9b06513e36878ba7164ef.tar.gz |
Added deprecation warning for load and checking the impact
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
Diffstat (limited to 'lib/chef/cookbook')
-rw-r--r-- | lib/chef/cookbook/cookbook_version_loader.rb | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/lib/chef/cookbook/cookbook_version_loader.rb b/lib/chef/cookbook/cookbook_version_loader.rb index f9ec765e47..8d4c3208fd 100644 --- a/lib/chef/cookbook/cookbook_version_loader.rb +++ b/lib/chef/cookbook/cookbook_version_loader.rb @@ -65,19 +65,14 @@ class Chef # Load the cookbook. Raises an error if the cookbook_path given to the # constructor doesn't point to a valid cookbook. def load! - file_paths_map = load + # file_paths_map = load - if empty? - raise Exceptions::CookbookNotFoundInRepo, "The directory #{cookbook_path} does not contain a cookbook" - end + # if empty? + # raise Exceptions::CookbookNotFoundInRepo, "The directory #{cookbook_path} does not contain a cookbook" + # end - file_paths_map - end + # file_paths_map - # Load the cookbook. Does not raise an error if given a non-cookbook - # directory as the cookbook_path. This behavior is provided for - # compatibility, it is recommended to use #load! instead. - def load metadata # force lazy evaluation to occur # re-raise any exception that occurred when reading the metadata @@ -93,6 +88,26 @@ class Chef cookbook_settings end + # Load the cookbook. Does not raise an error if given a non-cookbook + # directory as the cookbook_path. This behavior is provided for + # compatibility, it is recommended to use #load! instead. + def load + Chef::Log.warn "This 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? + # Chef::Log.warn "Found a directory #{cookbook_name} in the cookbook path, but it contains no cookbook files. skipping." + # end + # cookbook_settings + end + alias :load_cookbooks :load def cookbook_version |