Issue #3013 has been updated by James Turnbull. File _3013.patch added
<pre> >From 993a9032852c83b27204b9e531b927840d05aa4d Mon Sep 17 00:00:00 2001 From: Markus Roberts <[email protected]> Date: Thu, 7 Jan 2010 23:36:53 -0800 Subject: [PATCH] test fix for #3013 --- lib/puppet/util.rb | 9 ++++++--- lib/puppet/util/selinux.rb | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index e2df5c3..d2b729b 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -272,9 +272,12 @@ module Util if ! arguments[:squelch] output = '' begin - loop do - output << output_read.readpartial(4096) - end + method = output_read.respond_to?(:readpartial) ? :readpartial : :sysread + begin + output << output_read.send(method,4096) + "oink" + rescue Errno::EINTR + # Just popping out to handle an unrelated signal, but we're not done + end while true rescue EOFError # End of file ensure diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index 3801ecd..b3f9af5 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -156,7 +156,11 @@ module Puppet::Util::SELinux # If possible we use read_nonblock() in a loop rather than read() to work- # a linux kernel bug. See ticket #1963 for details. mountfh = File.open("/proc/mounts") - mounts += mountfh.read_nonblock(1024) while true + begin + mounts += mountfh.read_nonblock(1024) + rescue Errno::EINTR + # Popped out to process an unrelated signal, not because we're done + end while true else # Otherwise we shell out and let cat do it for us mountfh = IO.popen("/bin/cat /proc/mounts") -- 1.6.4.3 </pre> ---------------------------------------- Bug #3013: util.rb:execute broken on Ruby <1.8.3 http://projects.reductivelabs.com/issues/3013 Author: Ricky Zhou Status: Ready for Testing Priority: Urgent Assigned to: Markus Roberts Category: exec Target version: 0.25.3 Affected version: 0.25.2 Keywords: Branch: http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/3013 Apparently the patch in ticket #2731 introduced one more issue by using readpartial, which isn't available until ruby 1.8.3 (RHEL4 at least is affected). I'm not sure how this is normally handled in ruby, but if the readpartial function is not available, the code should fall back to sysread (along with some code for handling EINTR). Anybody with better ruby knowledge know how this should be done? -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://reductivelabs.com/redmine/my/account--
You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
