diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-07-06 20:31:29 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-07-20 11:45:27 -0700 |
commit | 30eaf758922c395082a4db64ac61bd5485e74c75 (patch) | |
tree | 649c2d4a73181081b60233059a587590d8d71519 /lib | |
parent | 26e9917e4d99ff3aaf4a78138016af46d5b5f9e9 (diff) | |
download | chef-30eaf758922c395082a4db64ac61bd5485e74c75.tar.gz |
Simplify logic and fix a few failures
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/resource/macos_userdefaults.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb index 571786fad0..6b85401b76 100644 --- a/lib/chef/resource/macos_userdefaults.rb +++ b/lib/chef/resource/macos_userdefaults.rb @@ -139,11 +139,11 @@ class Chef action_class do def defaults_write_cmd - cmd = ["defaults", "write", new_resource.domain, new_resource.key] + cmd = ["defaults", "write", "'#{new_resource.domain}'", "'#{new_resource.key}'"] cmd.prepend("sudo") if new_resource.sudo value = new_resource.value - type = !new_resource.type.empty? ? new_resource.type : value_type(value) + type = new_resource.type || value_type(value) # creates a string of Key1 Value1 Key2 Value2... value = value.map { |k, v| "\"#{k}\" \"#{v}\"" }.join(" ") if type == "dict" if type == "array" |