[Pkg-puppet-devel] [facter] 75/180: (FACT-477) On OpenBSD, when running on oVirt, correctly set is_virtual/virtual facts

Stig Sandbeck Mathisen ssm at debian.org
Mon Jun 30 15:06:32 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 ba1ed9b2bc6aa7127eb30b01719697ba07cf2336
Author: Jasper Lievisse Adriaanse <jasper at humppa.nl>
Date:   Tue Apr 15 14:07:33 2014 +0200

    (FACT-477) On OpenBSD, when running on oVirt, correctly set is_virtual/virtual facts
---
 lib/facter/virtual.rb     | 1 +
 spec/unit/virtual_spec.rb | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index 516db2e..9f195ea 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -105,6 +105,7 @@ Facter.add("virtual") do
       next "vmware"     if lines.any? {|l| l =~ /VMware/ }
       next "virtualbox" if lines.any? {|l| l =~ /VirtualBox/ }
       next "xenhvm"     if lines.any? {|l| l =~ /HVM domU/ }
+      next "ovirt"      if lines.any? {|l| l =~ /oVirt Node/ }
     end
   end
 end
diff --git a/spec/unit/virtual_spec.rb b/spec/unit/virtual_spec.rb
index fe0aa0d..16f08d6 100755
--- a/spec/unit/virtual_spec.rb
+++ b/spec/unit/virtual_spec.rb
@@ -279,6 +279,11 @@ describe "Virtual fact" do
       Facter::Core::Execution.stubs(:exec).with('sysctl -n hw.product 2>/dev/null').returns("HVM domU")
       Facter.fact(:virtual).value.should == "xenhvm"
     end
+
+    it "should be ovirt with oVirt Node product name from sysctl" do
+      Facter::Core::Execution.stubs(:exec).with('sysctl -n hw.product 2>/dev/null').returns("oVirt Node")
+      Facter.fact(:virtual).value.should == "ovirt"
+    end
   end
 
   describe "on Windows" do

-- 
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