Class: Facts::Linux::Hypervisors::Kvm

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

Constant Summary collapse

FACT_NAME =
'hypervisors.kvm'

Instance Method Summary collapse

Constructor Details

#initializeKvm

Returns a new instance of Kvm.



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

def initialize
  @log = Facter::Log.new(self)
end

Instance Method Details

#call_the_resolverObject



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

def call_the_resolver
  hypervisor = discover_hypervisor
  @log.debug("Detected hypervisor #{hypervisor}")

  return Facter::ResolvedFact.new(FACT_NAME, nil) if %w[virtualbox parallels].include?(hypervisor)

  fact_value = discover_provider if kvm?

  Facter::ResolvedFact.new(FACT_NAME, fact_value)
end