Class: Facts::Linux::Hypervisors::HyperV

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

Constant Summary collapse

FACT_NAME =
'hypervisors.hyperv'

Instance Method Summary collapse

Instance Method Details

#call_the_resolverObject



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

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

#check_hyper_vObject



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

def check_hyper_v
  manufacturer = Facter::Resolvers::Linux::DmiBios.resolve(:sys_vendor)
  product_name = Facter::Resolvers::Linux::DmiBios.resolve(:product_name)

  return {} if manufacturer =~ /Microsoft/ || product_name == 'Virtual Machine'

  nil
end