[Pkg-puppet-devel] [facter] 308/352: (FACT-357) Extract virtual fact vmware resolution

Stig Sandbeck Mathisen ssm at debian.org
Sun Apr 6 22:21:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit 9bb5e11013e39ca55540ec8f21dc182db39740dc
Author: Adrien Thebo <git at somethingsinistral.net>
Date:   Tue Mar 4 14:21:29 2014 -0800

    (FACT-357) Extract virtual fact vmware resolution
---
 lib/facter/virtual.rb | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index bc07bb9..98c2451 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -144,15 +144,23 @@ Facter.add("virtual") do
       next "ovirt"      if lines.any? {|l| l =~ /Product Name: oVirt Node/ }
     end
 
+    # Default to 'physical'
+    next 'physical'
+  end
+end
+
+Facter.add("virtual") do
+  confine do
+    Facter::Core::Execution.which('vmware')
+  end
+
+  setcode do
     # Sample output of vmware -v `VMware Server 1.0.5 build-80187`
     output = Facter::Core::Execution.exec("vmware -v")
     if output
       mdata = output.match /(\S+)\s+(\S+)/
       next "#{mdata[1]}_#{mdata[2]}".downcase if mdata
     end
-
-    # Default to 'physical'
-    next 'physical'
   end
 end
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list