diff options
author | James Turnbull <james@lovedthanlost.net> | 2011-04-06 02:13:54 +1000 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2011-04-06 02:13:54 +1000 |
commit | cf029c3d59b583afd2ce26ec335c6d5b49b166ba (patch) | |
tree | 007583c4515f9d3075076ba46919932005302893 /lib | |
parent | fc930d8c26c81075eb35ae728777f190d5af1402 (diff) | |
parent | 7f3e89de2d9da14bc7bef33709b79f48434eec6a (diff) | |
download | facter-cf029c3d59b583afd2ce26ec335c6d5b49b166ba.tar.gz facter-cf029c3d59b583afd2ce26ec335c6d5b49b166ba.tar.xz facter-cf029c3d59b583afd2ce26ec335c6d5b49b166ba.zip |
Merge remote branch 'adrien/tickets/next/2714' into next
* adrien/tickets/next/2714:
(#2714) Fixed faulty test
(#2714) Added timeout to prtdiag resulution
Diffstat (limited to 'lib')
-rw-r--r-- | 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 7c649ba..2801a43 100644 --- a/lib/facter/virtual.rb +++ b/lib/facter/virtual.rb @@ -119,8 +119,11 @@ Facter.add("virtual") do result = "vmware" if pd =~ /VMware/ result = "virtualbox" if pd =~ /VirtualBox/ 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/ |