Permalink
Browse files

Adds ability to set user for shell_out opts.

  • Loading branch information...
1 parent 20f0314 commit a25417fef34a5b04171c02a32975b73ae3841041 @patcon patcon committed Dec 7, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 providers/userdefaults.rb
@@ -31,7 +31,9 @@ def load_current_resource
drcmd = "defaults read #{new_resource.domain} "
drcmd << "-g " if new_resource.global
drcmd << "#{new_resource.key} " if new_resource.key
- v = shell_out("#{drcmd} | grep -qx '#{truefalse || new_resource.value}'")
+ shell_out_opts = {}
+ shell_out_opts[:user] = new_resource.user unless new_resource.user.nil?
+ v = shell_out("#{drcmd} | grep -qx '#{truefalse || new_resource.value}'", shell_out_opts)
is_set = v.exitstatus == 0 ? true : false
@userdefaults.is_set(is_set)
end

0 comments on commit a25417f

Please sign in to comment.