Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adds ability to set user for shell_out opts.

  • Loading branch information...
commit a25417fef34a5b04171c02a32975b73ae3841041 1 parent 20f0314
Patrick Connolly authored December 07, 2012

Showing 1 changed file with 3 additions and 1 deletion. Show diff stats Hide diff stats

  1. 4  providers/userdefaults.rb
4  providers/userdefaults.rb
@@ -31,7 +31,9 @@ def load_current_resource
31 31
   drcmd = "defaults read #{new_resource.domain} "
32 32
   drcmd << "-g " if new_resource.global
33 33
   drcmd << "#{new_resource.key} " if new_resource.key
34  
-  v = shell_out("#{drcmd} | grep -qx '#{truefalse || new_resource.value}'")
  34
+  shell_out_opts = {}
  35
+  shell_out_opts[:user] = new_resource.user unless new_resource.user.nil?
  36
+  v = shell_out("#{drcmd} | grep -qx '#{truefalse || new_resource.value}'", shell_out_opts)
35 37
   is_set = v.exitstatus == 0 ? true : false
36 38
   @userdefaults.is_set(is_set)
37 39
 end

0 notes on commit a25417f

Please sign in to comment.
Something went wrong with that request. Please try again.