Class: Facts::Linux::Hypervisors::Openvz

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/facts/linux/hypervisors/openvz.rb

Constant Summary collapse

FACT_NAME =
'hypervisors.openvz'

Instance Method Summary collapse

Instance Method Details

#call_the_resolverObject



9
10
11
12
# File 'lib/facter/facts/linux/hypervisors/openvz.rb', line 9

def call_the_resolver
  fact_value = check_openvz
  Facter::ResolvedFact.new(FACT_NAME, fact_value)
end

#check_openvzObject



14
15
16
17
18
19
20
21
# File 'lib/facter/facts/linux/hypervisors/openvz.rb', line 14

def check_openvz
  openvz = Facter::Resolvers::OpenVz.resolve(:vm)
  return unless openvz

  id = Facter::Resolvers::OpenVz.resolve(:id)

  { id: id.to_i, host: openvz == 'openvzhn' }
end