[Pkg-puppet-devel] [facter] 37/352: (#22789) Add vserver_host in physical_types
Stig Sandbeck Mathisen
ssm at debian.org
Sun Apr 6 22:21:29 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 fbb9007a2b570a88a6e74e6a7d31f97b3bda5a2c
Author: Theo Chatzimichos <tampakrap at gentoo.org>
Date: Sun Oct 6 13:49:59 2013 +0200
(#22789) Add vserver_host in physical_types
virtual => vserver_host was incorrectly shown as is_virtual => true
Adding it to physical_types variable so as it is properly shown as is_virtual => false
---
lib/facter/virtual.rb | 2 +-
spec/unit/virtual_spec.rb | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index 98f8f25..1f888f7 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -250,7 +250,7 @@ Facter.add("is_virtual") do
confine :kernel => %w{Linux FreeBSD OpenBSD SunOS HP-UX Darwin GNU/kFreeBSD windows}
setcode do
- physical_types = %w{physical xen0 vmware_server vmware_workstation openvzhn}
+ physical_types = %w{physical xen0 vmware_server vmware_workstation openvzhn vserver_host}
if physical_types.include? Facter.value(:virtual)
"false"
diff --git a/spec/unit/virtual_spec.rb b/spec/unit/virtual_spec.rb
index 88e3424..c53c009 100755
--- a/spec/unit/virtual_spec.rb
+++ b/spec/unit/virtual_spec.rb
@@ -389,6 +389,12 @@ describe "is_virtual fact" do
Facter.fact(:is_virtual).value.should == "true"
end
+ it "should be true when running on vserver" do
+ Facter.fact(:kernel).stubs(:value).returns("Linux")
+ Facter.fact(:virtual).stubs(:value).returns("vserver")
+ Facter.fact(:is_virtual).value.should == "true"
+ end
+
it "should be true when running on kvm" do
Facter.fact(:kernel).stubs(:value).returns("Linux")
Facter.fact(:virtual).stubs(:value).returns("kvm")
@@ -438,6 +444,12 @@ describe "is_virtual fact" do
Facter.fact(:is_virtual).value.should == "false"
end
+ it "should be false on vserver host nodes" do
+ Facter.fact(:kernel).stubs(:value).returns("Linux")
+ Facter.fact(:virtual).stubs(:value).returns("vserver_host")
+ Facter.fact(:is_virtual).value.should == "false"
+ end
+
it "should be true when running on hyperv" do
Facter.fact(:kernel).stubs(:value).returns("Linux")
Facter.fact(:virtual).stubs(:value).returns("hyperv")
--
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