summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-09-28 17:43:50 -0700
committerTim Smith <tsmith@chef.io>2018-02-26 12:22:02 -0800
commit0f8f54197d6683ae21c6fb8bff7f78d36e54f341 (patch)
treee1fa39c7ddc6c360779e5ce2cf5199733a1cbc0c /lib
parente4844f8926cf5a04c5e93291175b5f2bab262680 (diff)
downloadchef-0f8f54197d6683ae21c6fb8bff7f78d36e54f341.tar.gz
Add some comments
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/apt_repository.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/chef/provider/apt_repository.rb b/lib/chef/provider/apt_repository.rb
index 8f7fb5cd03..d6d8dc0f62 100644
--- a/lib/chef/provider/apt_repository.rb
+++ b/lib/chef/provider/apt_repository.rb
@@ -131,14 +131,27 @@ class Chef
valid
end
+ # return the specified cookbook name or the cookbook containing the
+ # resource.
+ #
+ # @return [String] name of the cookbook
def cookbook_name
new_resource.cookbook || new_resource.cookbook_name
end
+ # determine if a cookbook file is available in the run
+ # @param [String] path the path to the cookbook file
+ #
+ # @return [Boolean] cookbook file exists or doesn't
def has_cookbook_file?(fn)
run_context.has_cookbook_file_in_cookbook?(cookbook_name, fn)
end
+ # determine if there are any new keys by comparing the fingerprints of installed
+ # keys to those of the passed file
+ # @param [String] file the keyfile of the new repository
+ #
+ # @return [Boolean] true: no new keys in the file. false: there are new keys
def no_new_keys?(file)
# Now we are using the option --with-colons that works across old os versions
# as well as the latest (16.10). This for both `apt-key` and `gpg` commands