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

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


The following commit has been merged in the upstream branch:
commit 8e4a68983ca7605f7fdf9ea441c26eef9ff6b42e
Author: James Turnbull <james at lovedthanlost.net>
Date:   Sat May 2 21:40:22 2009 +1000

    Fixes #2169 Correctly recognises dom0 and domUs

diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index 3ad6f8a..78e5485 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -18,17 +18,21 @@ Facter.add("virtual") do
             end
         end
 
-        Thread::exclusive do
-            if FileTest.exists?("/proc/xen/capabilities") && FileTest.readable?("/proc/xen/capabilities")
-                txt = File.read("/proc/xen/capabilities")
-                    if txt =~ /control_d/i
-                        result = "xen0"
-                    else
-                        result = "xenu"
-                    end
-             end
+        # new Xen domains have this in dom0 not domu :(
+        if FileTest.exists?("/proc/sys/xen/independent_wallclock")
+            result = "xenu" 
         end
-
+        if FileTest.exists?("/sys/bus/xen")
+            result = "xenu" 
+        end
+        
+        if FileTest.exists?("/proc/xen/capabilities")
+            txt = File.read("/proc/xen/capabilities")
+            if txt =~ /control_d/i
+                result = "xen0" 
+            end
+        end
+ 
         if result == "physical"
             output = Facter::Util::Resolution.exec('lspci')
             if not output.nil?

-- 
Packaging of Facter for debian



More information about the Pkg-puppet-devel mailing list