summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/resource/apt_repository.rb22
-rw-r--r--lib/chef/resource/launchd.rb6
-rw-r--r--lib/chef/version.rb2
3 files changed, 24 insertions, 6 deletions
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb
index 80df76ef4c..7e2ced5c92 100644
--- a/lib/chef/resource/apt_repository.rb
+++ b/lib/chef/resource/apt_repository.rb
@@ -187,6 +187,24 @@ class Chef
end.compact
end
+ # run the specified command and extract the public key ids
+ # accepts the command so it can be used to extract both the current keys
+ # and the new keys
+ # @param [Array<String>] cmd the command to run
+ #
+ # @return [Array] an array of key ids
+ def extract_public_keys_from_cmd(*cmd)
+ so = shell_out(*cmd)
+ # Sample output
+ # pub:-:4096:1:D94AA3F0EFE21092:1336774248:::-:::scSC::::::23::0:
+ so.stdout.split(/\n/).map do |t|
+ if t.match(/^pub:/)
+ f = t.split(":")
+ f.slice(0, 6).join(":")
+ end
+ end.compact
+ end
+
# validate the key against the apt keystore to see if that version is expired
# @param [String] key
#
@@ -222,8 +240,8 @@ class Chef
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
- installed_keys = extract_fingerprints_from_cmd(*LIST_APT_KEY_FINGERPRINTS)
- proposed_keys = extract_fingerprints_from_cmd("gpg", "--with-fingerprint", "--with-colons", file)
+ installed_keys = extract_public_keys_from_cmd(*LIST_APT_KEY_FINGERPRINTS)
+ proposed_keys = extract_public_keys_from_cmd("gpg", "--with-fingerprint", "--with-colons", file)
(installed_keys & proposed_keys).sort == proposed_keys.sort
end
diff --git a/lib/chef/resource/launchd.rb b/lib/chef/resource/launchd.rb
index 5ddf6ea0f9..719938dec2 100644
--- a/lib/chef/resource/launchd.rb
+++ b/lib/chef/resource/launchd.rb
@@ -21,7 +21,7 @@ require_relative "../resource"
class Chef
class Resource
class Launchd < Chef::Resource
- provides :launchd
+ provides :launchd, os: "darwin"
description "Use the **launchd** resource to manage system-wide services (daemons) and per-user services (agents) on the macOS platform."
introduced "12.8"
@@ -129,8 +129,8 @@ class Chef
property :abandon_process_group, [ TrueClass, FalseClass ],
description: "If a job dies, all remaining processes with the same process ID may be kept running. Set to true to kill all remaining processes."
- property :associated_bundle_identifiers, Hash,
- description: "This optional key indicates which bundles the **Login Items Added by Apps** panel associates with the helper executable."
+ property :associated_bundle_identifiers, Array,
+ description: "This optional key indicates which bundles the Login Items Added by Apps panel associates with the helper executable."
property :debug, [ TrueClass, FalseClass ],
description: "Sets the log mask to `LOG_DEBUG` for this job."
diff --git a/lib/chef/version.rb b/lib/chef/version.rb
index 64eb0eb52d..cd9ee1c245 100644
--- a/lib/chef/version.rb
+++ b/lib/chef/version.rb
@@ -23,7 +23,7 @@ require_relative "version_string"
class Chef
CHEF_ROOT = File.expand_path("..", __dir__)
- VERSION = Chef::VersionString.new("18.1.11")
+ VERSION = Chef::VersionString.new("18.1.28")
end
#