[Pkg-puppet-devel] [SCM] Packaging of Facter for debian branch, upstream, updated. 3a39dd8353b6308cf49522990104cc63e55d7cda

James Turnbull james at lovedthanlost.net
Fri Jan 29 17:22:31 UTC 2010


The following commit has been merged in the upstream branch:
commit 68e0b243d2098c7e83187a119baabeaac5acb81d
Author: Paul Nasrat <pnasrat at googlemail.com>
Date:   Fri May 22 08:20:46 2009 +0100

    Fix #2278 Revert fix for 2120
    
    Facter #2120 -  Solaris support for Facter[virtual]
    
    This reverts commit 56760d34f070db4d7bb8e5fcfb7939fe3074bf49.
    
    This patch is broken as $? global will report last run process in the case of
    no vmware-checkvm binary

diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index 37381d4..203d306 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -48,31 +48,25 @@ Facter.add("virtual") do
         end
  
         if result == "physical"
-            output = Facter::Util::Resolution.exec('vmware-checkvm')
-            if $?.exitstatus == 0
-                result = "vmware"
+            output = Facter::Util::Resolution.exec('lspci')
+            if not output.nil?
+                output.each_line do |p|
+                    # --- look for the vmware video card to determine if it is virtual => vmware.
+                    # ---     00:0f.0 VGA compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter
+                    result = "vmware" if p =~ /VM[wW]are/
+                end
             else
-                output = Facter::Util::Resolution.exec('lspci')
+                output = Facter::Util::Resolution.exec('dmidecode')
                 if not output.nil?
-                    output.each_line do |p|
-                        # --- look for the vmware video card to determine if it is virtual => vmware.
-                        # ---     00:0f.0 VGA compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter
-                        result = "vmware" if p =~ /VM[wW]are/
+                    output.each_line do |pd|
+                        result = "vmware" if pd =~ /VMware|Parallels/
                     end
                 else
-                    output = Facter::Util::Resolution.exec('dmidecode')
+                    output = Facter::Util::Resolution.exec('prtdiag')
                     if not output.nil?
                         output.each_line do |pd|
                             result = "vmware" if pd =~ /VMware|Parallels/
                         end
-                    elsif Facter[:kernel].value == 'SunOS' and Facter[:kernelrelease].value == '5.10'
-                        # prtdiag only works on Solaris 10 x86 hosts
-                        output = Facter::Util::Resolution.exec('prtdiag')
-                        if not output.nil?
-                            output.each_line do |pd|
-                                result = "vmware" if pd =~ /VMware|Parallels/
-                            end
-                        end
                     end
                 end
             end

-- 
Packaging of Facter for debian



More information about the Pkg-puppet-devel mailing list