summaryrefslogtreecommitdiff
path: root/lib/chef/resource/plist.rb
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2022-04-07 08:46:41 -0700
committerGitHub <noreply@github.com>2022-04-07 08:46:41 -0700
commitbf652837e634a0271d726a7b3dfe6f50e8e04cbc (patch)
tree80e424184d748bda1b8bba69d473d1344064d1b1 /lib/chef/resource/plist.rb
parent09ef2bba5251b018ea477f5158b55918382b0e79 (diff)
parentf61168f78a52f28c170feb3c6a65061d91e7cb25 (diff)
downloadchef-bf652837e634a0271d726a7b3dfe6f50e8e04cbc.tar.gz
Merge branch 'main' into jfm/platform_updates
Diffstat (limited to 'lib/chef/resource/plist.rb')
-rw-r--r--lib/chef/resource/plist.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/chef/resource/plist.rb b/lib/chef/resource/plist.rb
index 6783ae5f51..d316d81b2a 100644
--- a/lib/chef/resource/plist.rb
+++ b/lib/chef/resource/plist.rb
@@ -84,7 +84,7 @@ class Chef
converge_if_changed :path do
converge_by "create new plist: '#{new_resource.path}'" do
file new_resource.path do
- content {}.to_plist
+ content({}.to_plist)
owner new_resource.owner
group new_resource.group
mode new_resource.mode if property_is_set?(:mode)
@@ -188,7 +188,12 @@ class Chef
sep = " "
arg = case subcommand.to_s
when "add"
- type_to_commandline_string(value)
+ if value.is_a?(Hash)
+ sep = ":"
+ value.map { |k, v| "#{k} #{type_to_commandline_string(v)}" }
+ else
+ type_to_commandline_string(value)
+ end
when "set"
if value.is_a?(Hash)
sep = ":"