diff options
author | Paul Nasrat <pnasrat@googlemail.com> | 2009-09-05 06:45:50 +0100 |
---|---|---|
committer | Paul Nasrat <pnasrat@googlemail.com> | 2009-09-09 07:04:44 +0100 |
commit | 49470cf776f2c23cabec00b68b85a1264a3f7b48 (patch) | |
tree | bd1dd2d50d79836569451658a12cee4c89dc199a /lib/facter/virtual.rb | |
parent | 9515a403b2a3350b3b6eb2c1578c5871e9588ac2 (diff) | |
download | facter-49470cf776f2c23cabec00b68b85a1264a3f7b48.tar.gz facter-49470cf776f2c23cabec00b68b85a1264a3f7b48.tar.xz facter-49470cf776f2c23cabec00b68b85a1264a3f7b48.zip |
Fix broken solaris zone tests on EC2
This cleans up xen and vserver detection to enable us to stub out so when we
happen to be running tests on xen we don't report as that.
More cleanup is needed in this area but this should give us a green build.
This renames the tests to be consistent with current naming convention
Diffstat (limited to 'lib/facter/virtual.rb')
-rw-r--r-- | lib/facter/virtual.rb | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb index 299ebb4..78413a9 100644 --- a/lib/facter/virtual.rb +++ b/lib/facter/virtual.rb @@ -13,24 +13,24 @@ Facter.add("virtual") do result = Facter::Util::Virtual.openvz_type() end - result = "vserver" if Facter::Util::Virtual.vserver? - - if FileTest.exists?("/proc/virtual") - result = "vserver_host" + if Facter::Util::Virtual.vserver? + result = Facter::Util::Virtual.vserver_type() 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 Facter::Util::Virtual.xen? + # 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" + if FileTest.exists?("/proc/xen/capabilities") + txt = File.read("/proc/xen/capabilities") + if txt =~ /control_d/i + result = "xen0" + end end end @@ -57,11 +57,10 @@ Facter.add("virtual") do end end end - end - - # VMware server 1.0.3 rpm places vmware-vmx in this place, other versions or platforms may not. - if FileTest.exists?("/usr/lib/vmware/bin/vmware-vmx") - result = "vmware_server" + # VMware server 1.0.3 rpm places vmware-vmx in this place, other versions or platforms may not. + if FileTest.exists?("/usr/lib/vmware/bin/vmware-vmx") + result = "vmware_server" + end end result |