facter 1.5.6 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of facter might be problematic. Click here for more details.
- data/CHANGELOG +496 -344
- data/COPYING +12 -13
- data/ChangeLog +1727 -0
- data/LICENSE +13 -670
- data/Rakefile +17 -54
- data/install.rb +5 -4
- data/lib/facter.rb +2 -2
- data/lib/facter/ipaddress.rb +2 -2
- data/lib/facter/manufacturer.rb +22 -11
- data/lib/facter/netmask.rb +1 -1
- data/lib/facter/operatingsystemrelease.rb +12 -52
- data/lib/facter/path.rb +5 -0
- data/lib/facter/util/ip.rb +8 -1
- data/lib/facter/util/loader.rb +5 -1
- data/lib/facter/util/macosx.rb +7 -3
- data/lib/facter/util/manufacturer.rb +13 -2
- data/lib/facter/util/netmask.rb +7 -1
- data/lib/facter/util/resolution.rb +1 -0
- data/lib/facter/util/virtual.rb +43 -0
- data/lib/facter/virtual.rb +26 -40
- data/spec/spec.opts +2 -0
- data/spec/unit/data/solaris_ifconfig_all_with_multiple_interfaces +8 -0
- data/spec/unit/facter.rb +16 -0
- data/spec/unit/operatingsystem.rb +4 -1
- data/spec/unit/util/ip.rb +23 -0
- data/spec/unit/util/loader.rb +10 -0
- data/spec/unit/util/macosx.rb +34 -0
- data/spec/unit/util/resolution.rb +21 -0
- data/spec/unit/util/virtual.rb +96 -0
- data/spec/unit/virtual.rb +51 -0
- metadata +70 -64
data/Rakefile
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
# Rakefile for facter
|
2
2
|
|
3
3
|
$: << File.expand_path('lib')
|
4
|
+
$LOAD_PATH << File.join(File.dirname(__FILE__), 'tasks')
|
5
|
+
|
6
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
4
7
|
|
5
8
|
require './lib/facter.rb'
|
6
9
|
require 'rake'
|
@@ -44,65 +47,25 @@ end
|
|
44
47
|
Rake::GemPackageTask.new(spec) do |pkg|
|
45
48
|
end
|
46
49
|
|
50
|
+
task :default do
|
51
|
+
sh %{rake -T}
|
52
|
+
end
|
53
|
+
|
47
54
|
desc "Run the specs under spec/"
|
48
55
|
task :spec do
|
49
56
|
require 'spec'
|
50
57
|
require 'spec/rake/spectask'
|
51
|
-
# require 'rcov'
|
52
|
-
Spec::Rake::SpecTask.new do |t|
|
53
|
-
t.spec_opts = ['--format','s', '--loadby','mtime']
|
54
|
-
t.spec_files = FileList['spec/**/*.rb']
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
desc "Prep CI RSpec tests"
|
59
|
-
task :ci_prep do
|
60
|
-
require 'rubygems'
|
61
58
|
begin
|
62
|
-
|
63
|
-
|
64
|
-
require 'ci/reporter/rake/test_unit'
|
65
|
-
ENV['CI_REPORTS'] = 'results'
|
66
|
-
rescue LoadError
|
67
|
-
puts 'Missing ci_reporter gem. You must have the ci_reporter gem installed to run the CI spec tests'
|
59
|
+
require 'rcov'
|
60
|
+
rescue LoadError
|
68
61
|
end
|
69
|
-
end
|
70
|
-
|
71
|
-
desc "Run the CI RSpec tests"
|
72
|
-
task :ci_spec => [:ci_prep, 'ci:setup:rpsec', :spec]
|
73
62
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
end
|
83
|
-
branch = $1
|
84
|
-
|
85
|
-
unless branch =~ %r{^([^\/]+)/([^\/]+)/([^\/]+)$}
|
86
|
-
raise "Branch name does not follow <type>/<parent>/<name> model; cannot autodetect parent branch"
|
87
|
-
end
|
88
|
-
|
89
|
-
type, parent, name = $1, $2, $3
|
90
|
-
|
91
|
-
# Create all of the patches
|
92
|
-
sh "git format-patch -C -M -s -n --subject-prefix='PATCH/facter' #{parent}..HEAD"
|
93
|
-
|
94
|
-
# And then mail them out.
|
95
|
-
|
96
|
-
# If we've got more than one patch, add --compose
|
97
|
-
if Dir.glob("00*.patch").length > 1
|
98
|
-
compose = "--compose"
|
99
|
-
else
|
100
|
-
compose = ""
|
101
|
-
end
|
102
|
-
|
103
|
-
# Now send the mail.
|
104
|
-
sh "git send-email #{compose} --no-signed-off-by-cc --suppress-from --to puppet-dev@googlegroups.com 00*.patch"
|
105
|
-
|
106
|
-
# Finally, clean up the patches
|
107
|
-
sh "rm 00*.patch"
|
63
|
+
Spec::Rake::SpecTask.new do |t|
|
64
|
+
t.spec_opts = ['--format','s', '--loadby','mtime']
|
65
|
+
t.spec_files = FileList['spec/**/*.rb']
|
66
|
+
if defined?(Rcov)
|
67
|
+
t.rcov = true
|
68
|
+
t.rcov_opts = ['--exclude', 'spec/*,test/*,results/*,/usr/lib/*,/usr/local/lib/*']
|
69
|
+
end
|
70
|
+
end
|
108
71
|
end
|
data/install.rb
CHANGED
@@ -205,13 +205,14 @@ def prepare_installation
|
|
205
205
|
version = [Config::CONFIG["MAJOR"], Config::CONFIG["MINOR"]].join(".")
|
206
206
|
libdir = File.join(Config::CONFIG["libdir"], "ruby", version)
|
207
207
|
|
208
|
-
# Mac OS X 10.5
|
208
|
+
# Mac OS X 10.5 and higher declare bindir and sbindir as
|
209
209
|
# /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
|
210
210
|
# /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/sbin
|
211
211
|
# which is not generally where people expect executables to be installed
|
212
|
-
|
213
|
-
|
214
|
-
|
212
|
+
# These settings are appropriate defaults for all OS X versions.
|
213
|
+
if RUBY_PLATFORM =~ /^universal-darwin[\d\.]+$/
|
214
|
+
Config::CONFIG['bindir'] = "/usr/bin"
|
215
|
+
Config::CONFIG['sbindir'] = "/usr/sbin"
|
215
216
|
end
|
216
217
|
|
217
218
|
if not InstallOptions.bindir.nil?
|
data/lib/facter.rb
CHANGED
@@ -27,7 +27,7 @@ module Facter
|
|
27
27
|
include Comparable
|
28
28
|
include Enumerable
|
29
29
|
|
30
|
-
FACTERVERSION = '1.5.
|
30
|
+
FACTERVERSION = '1.5.7'
|
31
31
|
# = Facter
|
32
32
|
# Functions as a hash of 'facts' you might care about about your
|
33
33
|
# system, such as mac address, IP address, Video card, etc.
|
@@ -120,7 +120,7 @@ module Facter
|
|
120
120
|
name = name.to_s.sub(/\?$/,'')
|
121
121
|
end
|
122
122
|
|
123
|
-
if fact =
|
123
|
+
if fact = collection.fact(name)
|
124
124
|
if question
|
125
125
|
value = fact.value.downcase
|
126
126
|
args.each do |arg|
|
data/lib/facter/ipaddress.rb
CHANGED
@@ -19,7 +19,7 @@ Facter.add(:ipaddress) do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
Facter.add(:ipaddress) do
|
22
|
-
confine :kernel => %w{FreeBSD OpenBSD
|
22
|
+
confine :kernel => %w{FreeBSD OpenBSD}
|
23
23
|
setcode do
|
24
24
|
ip = nil
|
25
25
|
output = %x{/sbin/ifconfig}
|
@@ -39,7 +39,7 @@ Facter.add(:ipaddress) do
|
|
39
39
|
end
|
40
40
|
|
41
41
|
Facter.add(:ipaddress) do
|
42
|
-
confine :kernel => %w{NetBSD}
|
42
|
+
confine :kernel => %w{NetBSD SunOS}
|
43
43
|
setcode do
|
44
44
|
ip = nil
|
45
45
|
output = %x{/sbin/ifconfig -a}
|
data/lib/facter/manufacturer.rb
CHANGED
@@ -5,15 +5,26 @@
|
|
5
5
|
|
6
6
|
require 'facter/util/manufacturer'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
8
|
+
if Facter.value(:kernel) == "OpenBSD"
|
9
|
+
mfg_keys = {
|
10
|
+
'hw.vendor' => 'manufacturer',
|
11
|
+
'hw.product' => 'productname',
|
12
|
+
'hw.serialno' => 'serialnumber'
|
13
|
+
}
|
14
|
+
|
15
|
+
Facter::Manufacturer.sysctl_find_system_info(mfg_keys)
|
16
|
+
else
|
17
|
+
query = {
|
18
|
+
'[Ss]ystem [Ii]nformation' => [
|
19
|
+
{ 'Manufacturer:' => 'manufacturer' },
|
20
|
+
{ 'Product(?: Name)?:' => 'productname' },
|
21
|
+
{ 'Serial Number:' => 'serialnumber' }
|
22
|
+
],
|
23
|
+
'(Chassis Information|system enclosure or chassis)' => [
|
24
|
+
{ '(?:Chassis )?Type:' => 'type' }
|
25
|
+
]
|
26
|
+
}
|
27
|
+
|
28
|
+
Facter::Manufacturer.dmi_find_system_info(query)
|
29
|
+
end
|
18
30
|
|
19
|
-
Facter::Manufacturer.dmi_find_system_info(query)
|
data/lib/facter/netmask.rb
CHANGED
@@ -1,67 +1,27 @@
|
|
1
1
|
Facter.add(:operatingsystemrelease) do
|
2
|
-
confine :operatingsystem =>
|
2
|
+
confine :operatingsystem => %w{CentOS Fedora oel ovs RedHat}
|
3
3
|
setcode do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
4
|
+
case Facter.value(:operatingsystem)
|
5
|
+
when "CentOS", "RedHat"
|
6
|
+
releasefile = "/etc/redhat-release"
|
7
|
+
when "Fedora"
|
8
|
+
releasefile = "/etc/fedora-release"
|
9
|
+
when "oel"
|
10
|
+
releasefile = "/etc/enterprise-release"
|
11
|
+
when "ovs"
|
12
|
+
releasefile = "/etc/ovs-release"
|
11
13
|
end
|
12
|
-
|
13
|
-
end
|
14
|
-
|
15
|
-
Facter.add(:operatingsystemrelease) do
|
16
|
-
confine :operatingsystem => %w{RedHat}
|
17
|
-
setcode do
|
18
|
-
File::open("/etc/redhat-release", "r") do |f|
|
14
|
+
File::open(releasefile, "r") do |f|
|
19
15
|
line = f.readline.chomp
|
20
16
|
if line =~ /\(Rawhide\)$/
|
21
17
|
"Rawhide"
|
22
|
-
elsif line =~ /release (\d
|
18
|
+
elsif line =~ /release (\d[\d.]*)/
|
23
19
|
$1
|
24
20
|
end
|
25
21
|
end
|
26
22
|
end
|
27
23
|
end
|
28
24
|
|
29
|
-
Facter.add(:operatingsystemrelease) do
|
30
|
-
confine :operatingsystem => :oel
|
31
|
-
setcode do
|
32
|
-
File::open("/etc/enterprise-release", "r") do |f|
|
33
|
-
line = f.readline.chomp
|
34
|
-
if line =~ /release (\d+)/
|
35
|
-
$1
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
Facter.add(:operatingsystemrelease) do
|
42
|
-
confine :operatingsystem => :ovs
|
43
|
-
setcode do
|
44
|
-
File::open("/etc/ovs-release", "r") do |f|
|
45
|
-
line = f.readline.chomp
|
46
|
-
if line =~ /release (\d+)/
|
47
|
-
$1
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
Facter.add(:operatingsystemrelease) do
|
54
|
-
confine :operatingsystem => %w{CentOS}
|
55
|
-
setcode do
|
56
|
-
centos_release = Facter::Util::Resolution.exec("sed -r -e 's/CentOS release //' -e 's/ \\((Branch|Final)\\)//' /etc/redhat-release")
|
57
|
-
if centos_release =~ /^5/
|
58
|
-
release = Facter::Util::Resolution.exec('rpm -q --qf \'%{VERSION}.%{RELEASE}\' centos-release | cut -d. -f1,2')
|
59
|
-
else
|
60
|
-
release = centos_release
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
25
|
Facter.add(:operatingsystemrelease) do
|
66
26
|
confine :operatingsystem => %w{Debian}
|
67
27
|
setcode do
|
data/lib/facter/path.rb
ADDED
data/lib/facter/util/ip.rb
CHANGED
@@ -51,7 +51,7 @@ module Facter::Util::IP
|
|
51
51
|
# at the end of interfaces. So, we have to trim those trailing
|
52
52
|
# characters. I tried making the regex better but supporting all
|
53
53
|
# platforms with a single regex is probably a bit too much.
|
54
|
-
output.scan(/^\w+[.:]?\d+[.:]?\d*[.:]?\w*/).collect { |i| i.sub(/:$/, '') }
|
54
|
+
output.scan(/^\w+[.:]?\d+[.:]?\d*[.:]?\w*/).collect { |i| i.sub(/:$/, '') }.uniq
|
55
55
|
end
|
56
56
|
|
57
57
|
def self.get_all_interface_output
|
@@ -84,6 +84,13 @@ module Facter::Util::IP
|
|
84
84
|
if not FileTest.executable?("/sbin/ip")
|
85
85
|
return nil
|
86
86
|
end
|
87
|
+
# A bonding interface can never be an alias interface. Alias
|
88
|
+
# interfaces do have a colon in their name and the ip link show
|
89
|
+
# command throws an error message when we pass it an alias
|
90
|
+
# interface.
|
91
|
+
if interface =~ /:/
|
92
|
+
return nil
|
93
|
+
end
|
87
94
|
regex = /SLAVE[,>].* (bond[0-9]+)/
|
88
95
|
ethbond = regex.match(%x{/sbin/ip link show #{interface}})
|
89
96
|
if ethbond
|
data/lib/facter/util/loader.rb
CHANGED
@@ -69,7 +69,11 @@ class Facter::Util::Loader
|
|
69
69
|
|
70
70
|
def load_file(file)
|
71
71
|
# We have to specify Kernel.load, because we have a load method.
|
72
|
-
|
72
|
+
begin
|
73
|
+
Kernel.load(file)
|
74
|
+
rescue ScriptError => detail
|
75
|
+
warn "Error loading fact #{file} #{detail}"
|
76
|
+
end
|
73
77
|
end
|
74
78
|
|
75
79
|
# Load facts from the environment. If no name is provided,
|
data/lib/facter/util/macosx.rb
CHANGED
@@ -56,12 +56,16 @@ module Facter::Util::Macosx
|
|
56
56
|
def self.sw_vers
|
57
57
|
ver = Hash.new
|
58
58
|
[ "productName", "productVersion", "buildVersion" ].each do |option|
|
59
|
-
ver["macosx_#{option}"] =
|
59
|
+
ver["macosx_#{option}"] = Facter::Util::Resolution.exec("/usr/bin/sw_vers -#{option}").strip
|
60
60
|
end
|
61
61
|
productversion = ver["macosx_productVersion"]
|
62
62
|
if not productversion.nil?
|
63
|
-
|
64
|
-
ver["
|
63
|
+
versions = productversion.scan(/(\d+)\.(\d+)\.*(\d*)/)[0]
|
64
|
+
ver["macosx_productversion_major"] = "#{versions[0]}.#{versions[1]}"
|
65
|
+
if versions[2].empty? # 10.x should be treated as 10.x.0
|
66
|
+
versions[2] = "0"
|
67
|
+
end
|
68
|
+
ver["macosx_productversion_minor"] = versions[2]
|
65
69
|
end
|
66
70
|
ver
|
67
71
|
end
|
@@ -9,7 +9,7 @@ module Facter::Manufacturer
|
|
9
9
|
return nil unless FileTest.exists?("/usr/sbin/dmidecode")
|
10
10
|
|
11
11
|
output=%x{/usr/sbin/dmidecode 2>/dev/null}
|
12
|
-
when '
|
12
|
+
when 'FreeBSD'
|
13
13
|
return nil unless FileTest.exists?("/usr/local/sbin/dmidecode")
|
14
14
|
|
15
15
|
output=%x{/usr/local/sbin/dmidecode 2>/dev/null}
|
@@ -32,7 +32,7 @@ module Facter::Manufacturer
|
|
32
32
|
if line =~ /#{key}/ and ( line =~ /#{value} 0x\d+ \(([-\w].*)\)\n*./ or line =~ /#{value} ([-\w].*)\n*./ )
|
33
33
|
result = $1
|
34
34
|
Facter.add(facterkey) do
|
35
|
-
confine :kernel => [ :linux, :freebsd, :netbsd, :
|
35
|
+
confine :kernel => [ :linux, :freebsd, :netbsd, :sunos ]
|
36
36
|
setcode do
|
37
37
|
result
|
38
38
|
end
|
@@ -43,4 +43,15 @@ module Facter::Manufacturer
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
def self.sysctl_find_system_info(name)
|
48
|
+
name.each do |sysctlkey,facterkey|
|
49
|
+
Facter.add(facterkey) do
|
50
|
+
confine :kernel => :openbsd
|
51
|
+
setcode do
|
52
|
+
Facter::Util::Resolution.exec("sysctl -n " + sysctlkey)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
46
57
|
end
|
data/lib/facter/util/netmask.rb
CHANGED
@@ -14,7 +14,13 @@ module Facter::NetMask
|
|
14
14
|
when 'SunOS'
|
15
15
|
ops = {
|
16
16
|
:ifconfig => '/usr/sbin/ifconfig -a',
|
17
|
-
:regex => %r{\s+ inet\s
|
17
|
+
:regex => %r{\s+ inet \s #{Facter.ipaddress} \s netmask \s (\w{8})}x,
|
18
|
+
:munge => Proc.new { |mask| mask.scan(/../).collect do |byte| byte.to_i(16) end.join('.') }
|
19
|
+
}
|
20
|
+
when 'FreeBSD','NetBSD','OpenBSD', 'Darwin'
|
21
|
+
ops = {
|
22
|
+
:ifconfig => '/sbin/ifconfig -a',
|
23
|
+
:regex => %r{\s+ inet \s #{Facter.ipaddress} \s netmask \s 0x(\w{8})}x,
|
18
24
|
:munge => Proc.new { |mask| mask.scan(/../).collect do |byte| byte.to_i(16) end.join('.') }
|
19
25
|
}
|
20
26
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
module Facter::Util::Virtual
|
2
|
+
def self.openvz?
|
3
|
+
FileTest.exists?("/proc/vz/veinfo")
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.openvz_type
|
7
|
+
return nil unless self.openvz?
|
8
|
+
if FileTest.exists?("/proc/vz/version")
|
9
|
+
result = "openvzhn"
|
10
|
+
else
|
11
|
+
result = "openvzve"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.zone?
|
16
|
+
z = Facter::Util::Resolution.exec("/sbin/zonename")
|
17
|
+
return false unless z
|
18
|
+
return z.chomp != 'global'
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.vserver?
|
22
|
+
return false unless FileTest.exists?("/proc/self/status")
|
23
|
+
txt = File.read("/proc/self/status")
|
24
|
+
return true if txt =~ /^(s_context|VxID):[[:blank:]]*[1-9]/
|
25
|
+
return false
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.vserver_type
|
29
|
+
if self.vserver?
|
30
|
+
if FileTest.exists?("/proc/virtual")
|
31
|
+
"vserver_host"
|
32
|
+
else
|
33
|
+
"vserver"
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.xen?
|
39
|
+
["/proc/sys/xen", "/sys/bus/xen", "/proc/xen" ].detect do |f|
|
40
|
+
FileTest.exists?(f)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
data/lib/facter/virtual.rb
CHANGED
@@ -1,52 +1,39 @@
|
|
1
|
+
require 'facter/util/virtual'
|
2
|
+
|
1
3
|
Facter.add("virtual") do
|
2
4
|
confine :kernel => %w{Linux FreeBSD OpenBSD SunOS}
|
3
5
|
|
4
6
|
result = "physical"
|
5
7
|
|
6
8
|
setcode do
|
7
|
-
require 'thread'
|
8
9
|
|
9
|
-
if
|
10
|
-
z = %x{"/sbin/zonename"}.chomp
|
11
|
-
if z != 'global'
|
12
|
-
result = 'zone'
|
13
|
-
end
|
14
|
-
end
|
10
|
+
result = "zone" if Facter::Util::Virtual.zone?
|
15
11
|
|
16
|
-
if
|
17
|
-
|
18
|
-
result = "openvzhn"
|
19
|
-
else
|
20
|
-
result = "openvzve"
|
21
|
-
end
|
12
|
+
if Facter::Util::Virtual.openvz?
|
13
|
+
result = Facter::Util::Virtual.openvz_type()
|
22
14
|
end
|
23
15
|
|
24
|
-
if
|
25
|
-
|
26
|
-
if txt =~ /^(s_context|VxID):[[:blank:]]*[1-9]/
|
27
|
-
result = "vserver"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
if FileTest.exists?("/proc/virtual")
|
32
|
-
result = "vserver_host"
|
16
|
+
if Facter::Util::Virtual.vserver?
|
17
|
+
result = Facter::Util::Virtual.vserver_type()
|
33
18
|
end
|
34
19
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
20
|
+
if Facter::Util::Virtual.xen?
|
21
|
+
# new Xen domains have this in dom0 not domu :(
|
22
|
+
if FileTest.exists?("/proc/sys/xen/independent_wallclock")
|
23
|
+
result = "xenu"
|
24
|
+
end
|
25
|
+
if FileTest.exists?("/sys/bus/xen")
|
26
|
+
result = "xenu"
|
27
|
+
end
|
42
28
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
29
|
+
if FileTest.exists?("/proc/xen/capabilities")
|
30
|
+
txt = File.read("/proc/xen/capabilities")
|
31
|
+
if txt =~ /control_d/i
|
32
|
+
result = "xen0"
|
33
|
+
end
|
47
34
|
end
|
48
35
|
end
|
49
|
-
|
36
|
+
|
50
37
|
if result == "physical"
|
51
38
|
output = Facter::Util::Resolution.exec('lspci')
|
52
39
|
if not output.nil?
|
@@ -70,11 +57,10 @@ Facter.add("virtual") do
|
|
70
57
|
end
|
71
58
|
end
|
72
59
|
end
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
result = "vmware_server"
|
60
|
+
# VMware server 1.0.3 rpm places vmware-vmx in this place, other versions or platforms may not.
|
61
|
+
if FileTest.exists?("/usr/lib/vmware/bin/vmware-vmx")
|
62
|
+
result = "vmware_server"
|
63
|
+
end
|
78
64
|
end
|
79
65
|
|
80
66
|
result
|
@@ -86,7 +72,7 @@ Facter.add("is_virtual") do
|
|
86
72
|
|
87
73
|
setcode do
|
88
74
|
case Facter.value(:virtual)
|
89
|
-
when "xenu", "openvzve", "vmware"
|
75
|
+
when "xenu", "openvzve", "vmware"
|
90
76
|
true
|
91
77
|
else
|
92
78
|
false
|