It's in my todo list, it's just that code review takes longer than other types of email. Today, hopefully?
On Dec 5, 2008, at 3:38 PM, Nigel Kersten wrote: > > Anyone? I have an upcoming provider that relies on this... and would > rather not rewrite execute just to support stdin within my provider. > > > On Thu, Dec 4, 2008 at 1:10 PM, Nigel Kersten <[EMAIL PROTECTED]> > wrote: >> >> add some more sanity checks around stdin >> >> Signed-off-by: Nigel Kersten <[EMAIL PROTECTED]> >> --- >> lib/puppet/util.rb | 10 ++++++++-- >> 1 files changed, 8 insertions(+), 2 deletions(-) >> >> diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb >> index 09c94c3..a5f3c5b 100644 >> --- a/lib/puppet/util.rb >> +++ b/lib/puppet/util.rb >> @@ -268,6 +268,9 @@ module Util >> >> # Execute the desired command, and return the status and output. >> # def execute(command, failonfail = true, uid = nil, gid = nil) >> + # :combine sets whether or not to combine stdout/stderr in the >> output >> + # :stdinfile sets a file that can be used for stdin. Passing a >> string >> + # for stdin is not currently supported. >> def execute(command, arguments = {:failonfail => true, :combine >> => true}) >> if command.is_a?(Array) >> command = command.flatten.collect { |i| i.to_s } >> @@ -321,7 +324,11 @@ module Util >> # Child process executes this >> Process.setsid >> begin >> - $stdin.reopen("/dev/null") >> + if arguments[:stdinfile] >> + $stdin.reopen(arguments[:stdinfile]) >> + else >> + $stdin.reopen("/dev/null") >> + end >> $stdout.reopen(output_file) >> $stderr.reopen(error_file) >> >> @@ -466,4 +473,3 @@ require 'puppet/util/execution' >> require 'puppet/util/logging' >> require 'puppet/util/package' >> require 'puppet/util/warnings' >> - >> -- >> 1.5.6.4 >> >> >>> >> > > > > -- > Nigel Kersten > Systems Administrator > Tech Lead - MacOps > > > -- The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. -- George Bernard Shaw --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en -~----------~----~----~----~------~----~------~--~---