diff options
author | Erik Gomez <e@eriknicolasgomez.com> | 2018-04-05 19:18:03 -0500 |
---|---|---|
committer | Erik Gomez <e@eriknicolasgomez.com> | 2018-04-05 19:18:03 -0500 |
commit | 4c23b44d231e298f239eac7ca1f8735272557738 (patch) | |
tree | 5908f63231701182b50cd5d41a59e50a1297c843 /lib | |
parent | dcabccc37c0017d7ca330f1c54e6fd385a51eaf8 (diff) | |
download | chef-4c23b44d231e298f239eac7ca1f8735272557738.tar.gz |
fix improper boolean to int conversion
Signed-off-by: Erik Gomez <e@eriknicolasgomez.com>
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 95e9a5e7b4..2f44a3d85a 100644 --- a/lib/chef/resource/macos_userdefaults.rb +++ b/lib/chef/resource/macos_userdefaults.rb @@ -43,7 +43,6 @@ class Chef property :value, [Integer, Float, String, TrueClass, FalseClass, Hash, Array], description: "The value of the key.", - coerce: proc { |v| coerce_booleans(v) }, required: true property :type, String, @@ -73,11 +72,12 @@ class Chef end load_current_value do |desired| + value = coerce_booleans(desired.value) drcmd = "defaults read '#{desired.domain}' " drcmd << "'#{desired.key}' " if desired.key shell_out_opts = {} shell_out_opts[:user] = desired.user unless desired.user.nil? - vc = shell_out("#{drcmd} | grep -qx '#{desired.value}'", shell_out_opts) + vc = shell_out("#{drcmd} | grep -qx '#{value}'", shell_out_opts) is_set vc.exitstatus == 0 ? true : false end |