Class: Facts::Windows::Networking::Fqdn

Inherits:
Object
  • Object
show all
Defined in:
lib/facter/facts/windows/networking/fqdn.rb

Constant Summary collapse

FACT_NAME =
'networking.fqdn'
ALIASES =
'fqdn'

Instance Method Summary collapse

Instance Method Details

#call_the_resolverObject



10
11
12
13
14
15
16
17
18
# File 'lib/facter/facts/windows/networking/fqdn.rb', line 10

def call_the_resolver
  domain = Facter::Resolvers::Windows::Networking.resolve(:domain)
  hostname = Facter::Resolvers::Hostname.resolve(:hostname)
  return Facter::ResolvedFact.new(FACT_NAME, nil) if !hostname || hostname.empty?

  fact_value = domain && !domain.empty? ? [hostname, domain].compact.join('.') : hostname

  [Facter::ResolvedFact.new(FACT_NAME, fact_value), Facter::ResolvedFact.new(ALIASES, fact_value, :legacy)]
end