diff options
author | Tim Smith <tsmith@chef.io> | 2018-03-29 13:50:26 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-03-29 13:51:01 -0700 |
commit | 044646140067c761a4885e4d025ca3f31c6b2b0b (patch) | |
tree | 67888ebf4aca1e64beeb5b2e50738a53f80cb606 /lib/chef/resource/macos_userdefaults.rb | |
parent | 8c84b80571a83ad1e2991fcf44241c58bc35ef68 (diff) | |
download | chef-044646140067c761a4885e4d025ca3f31c6b2b0b.tar.gz |
macos_userdefaults: Fix 2 failures
Avoid a method missing error on current_value and add the missing method from the helper library that wasn't copied in
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource/macos_userdefaults.rb')
-rw-r--r-- | lib/chef/resource/macos_userdefaults.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/chef/resource/macos_userdefaults.rb b/lib/chef/resource/macos_userdefaults.rb index abdf08c1d4..95e9a5e7b4 100644 --- a/lib/chef/resource/macos_userdefaults.rb +++ b/lib/chef/resource/macos_userdefaults.rb @@ -84,7 +84,7 @@ class Chef action :write do description "Write the setting to the specified domain" - unless current_value.is_set + unless current_resource.is_set cmd = ["defaults write"] cmd.unshift("sudo") if new_resource.sudo @@ -111,6 +111,23 @@ class Chef end end end + + action_class do + def value_type(value) + case value + when true, false + "bool" + when Integer + "int" + when Float + "float" + when Hash + "dict" + when Array + "array" + end + end + end end end end |