Class: Facts::Solaris::Zones

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/facts/solaris/zones.rb

Constant Summary collapse

FACT_NAME =
'solaris_zones.zones'
ALIASES =
%w[
  zone_.*_brand
  zone_.*_iptype
  zone_.*_name
  zone_.*_uuid
  zone_.*_id
  zone_.*_path
  zone_.*_status
  zones
].freeze

Instance Method Summary collapse

Instance Method Details

#call_the_resolverObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/facter/facts/solaris/zones.rb', line 18

def call_the_resolver
  resolved_facts = []
  zones = {}

  results = Facter::Resolvers::Solaris::Zone.resolve(:zone)
  return Facter::ResolvedFact.new(FACT_NAME, nil) unless results

  results&.each do |result|
    zones.merge!(parse_result(result))
    resolved_facts << create_legacy_zone_facts(result)
  end

  resolved_facts << Facter::ResolvedFact.new('solaris_zones.zones', zones)
  resolved_facts << Facter::ResolvedFact.new('zones', results.count, :legacy)

  resolved_facts.flatten
end