Skip to content
This repository has been archived by the owner on Nov 6, 2018. It is now read-only.

Commit

Permalink
Adds ability to set user for shell_out opts.
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Connolly committed Dec 7, 2012
1 parent 20f0314 commit a25417f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion providers/userdefaults.rb
Expand Up @@ -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
Expand Down

0 comments on commit a25417f

Please sign in to comment.