From 7de82c387b29b0c9202e35d680f109407c07faa7 Mon Sep 17 00:00:00 2001 From: Nigel Kersten Date: Thu, 4 Dec 2008 10:26:00 -0800 Subject: add support for stdin to Puppet::Util.execute --- lib/puppet/util.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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) -- cgit