- prtdiag would hang in specific cases, subsequently hanging facter.
   This should kill prtdiag if it takes excessively long.

Signed-off-by: Adrien Thebo <adr...@puppetlabs.com>
---
Local-branch: tickets/next/2714
 lib/facter/virtual.rb |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index 468ab77..0574a78 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -88,8 +88,11 @@ Facter.add("virtual") do
                         result = "parallels" if pd =~ /Parallels/
                         result = "vmware" if pd =~ /VMware/
                     end
-                else
-                    output = Facter::Util::Resolution.exec('prtdiag')
+                elsif Facter.value(:kernel) == 'SunOS'
+                    res = Facter::Util::Resolution.new('prtdiag')
+                    res.timeout = 6
+                    res.setcode('prtdiag')
+                    output = res.value
                     if not output.nil?
                         output.each_line do |pd|
                             result = "parallels" if pd =~ /Parallels/
-- 
1.7.4.1

-- 
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 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to