blob: 8db57a3fbfbc64341d540d524beb922be32191f7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
module Facter::Util::Virtual
def self.openvz?
FileTest.exists?("/proc/vz/veinfo")
end
def self.openvz_type
return nil unless self.openvz?
if FileTest.exists?("/proc/vz/version")
result = "openvzhn"
else
result = "openvzve"
end
end
def self.zone?
z = Facter::Util::Resolution.exec("/sbin/zonename")
return false unless z
return z.chomp != 'global'
end
def self.vserver?
return false unless FileTest.exists?("/proc/self/status")
txt = File.read("/proc/self/status")
return true if txt =~ /^(s_context|VxID):[[:blank:]]*[1-9]/
return false
end
end
|