Class: Facts::Linux::Hypervisors::Vmware

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

Constant Summary collapse

FACT_NAME =
'hypervisors.vmware'

Instance Method Summary collapse

Constructor Details

#initializeVmware

Returns a new instance of Vmware.



9
10
11
# File 'lib/facter/facts/linux/hypervisors/vmware.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
23
24
25
26
# File 'lib/facter/facts/linux/hypervisors/vmware.rb', line 13

def call_the_resolver
  if vmware?
    @log.debug('Vmware hypervisor detected')
    fact_value = {}

    version = Facter::Resolvers::DmiDecode.resolve(:vmware_version)
    fact_value[:version] = version if version && !version.empty?

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

  @log.debug('No Vmware hypervisor detected.')
  []
end