Class: Facts::Linux::Xen

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

Constant Summary collapse

FACT_NAME =
'xen'
ALIASES =
'xendomains'

Instance Method Summary collapse

Instance Method Details

#call_the_resolverObject



9
10
11
12
13
14
15
16
17
# File 'lib/facter/facts/linux/xen.rb', line 9

def call_the_resolver
  xen_type = check_virt_what || check_xen
  return Facter::ResolvedFact.new(FACT_NAME, nil) if !xen_type || xen_type != 'xen0'

  domains = Facter::Resolvers::Xen.resolve(:domains) || []

  [Facter::ResolvedFact.new(FACT_NAME, { domains: domains }),
   Facter::ResolvedFact.new(ALIASES, domains.entries.join(','), :legacy)]
end

#check_virt_whatObject



19
20
21
# File 'lib/facter/facts/linux/xen.rb', line 19

def check_virt_what
  Facter::Resolvers::VirtWhat.resolve(:vm)
end

#check_xenObject



23
24
25
# File 'lib/facter/facts/linux/xen.rb', line 23

def check_xen
  Facter::Resolvers::Xen.resolve(:vm)
end