summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-07-16 13:45:50 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-20 11:45:27 -0700
commit4fcd7909feeaa7f8210ece246f3b0ef1aa2184a2 (patch)
treec1a745c00b7d3265907c3d73e968f78b35533d6b
parentc91e1f4ae1733fb4e5bad178a2824130e243615a (diff)
downloadchef-4fcd7909feeaa7f8210ece246f3b0ef1aa2184a2.tar.gz
Avoid one failure condition with booleans
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/macos_userdefaults.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb
index 244ca6b5bb..1f84455c2b 100644
--- a/lib/chef/resource/macos_userdefaults.rb
+++ b/lib/chef/resource/macos_userdefaults.rb
@@ -85,7 +85,6 @@ class Chef
property :value, [Integer, Float, String, TrueClass, FalseClass, Hash, Array],
description: "The value of the key. Note: When setting boolean values you can either specify 0/1 or you can pass true/false, 'true'/false', or 'yes'/'no' and we'll automatically convert these to the proper boolean values Apple expects.",
- coerce: proc { |v| coerce_booleans(v) },
required: true
property :type, String,
@@ -187,6 +186,8 @@ class Chef
value.flatten.map { |x| "'#{x}'" }
when "array"
value.map { |x| "'#{x}'" }
+ when "bool"
+ value
else
"'#{value}'"
end