summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorNigel Kersten <nigelk@google.com>2008-12-04 10:26:00 -0800
committerJames Turnbull <james@lovedthanlost.net>2008-12-06 12:04:28 +1100
commit7de82c387b29b0c9202e35d680f109407c07faa7 (patch)
tree1047005a920e54ad087408762e2b4437ef8ac64a /lib
parentedef064ee2a2fe50113cbd2dde8e2bf45b500c55 (diff)
downloadpuppet-7de82c387b29b0c9202e35d680f109407c07faa7.tar.gz
puppet-7de82c387b29b0c9202e35d680f109407c07faa7.tar.xz
puppet-7de82c387b29b0c9202e35d680f109407c07faa7.zip
add support for stdin to Puppet::Util.execute
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/util.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index 09c94c3c9..b07b2dfec 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -268,7 +268,7 @@ module Util
# Execute the desired command, and return the status and output.
# def execute(command, failonfail = true, uid = nil, gid = nil)
- def execute(command, arguments = {:failonfail => true, :combine => true})
+ def execute(command, arguments = {:failonfail => true, :combine => true, :stdin => "/dev/null"})
if command.is_a?(Array)
command = command.flatten.collect { |i| i.to_s }
str = command.join(" ")
@@ -321,7 +321,7 @@ module Util
# Child process executes this
Process.setsid
begin
- $stdin.reopen("/dev/null")
+ $stdin.reopen(arguments[:stdin])
$stdout.reopen(output_file)
$stderr.reopen(error_file)