Fix retrieval of hostname fact based on network.

When Facter.value(:domain) is nil the facts fqdn_<network> are failing
with :

Could not retrieve fact='fqdn_external', resolution='<anonymous>': undefined method `empty?' for nil:NilClass

Change-Id: I3e7fa983d4cf91c6ab25f9aa4c353b364f44826e
Closes-bug: 1595125
This commit is contained in:
Sofer Athlan-Guyot 2016-06-22 12:23:10 +02:00 committed by Athlan-Guyot sofer
parent adc02fd625
commit edde5b9a28
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@
Facter.value(:hostname),
network,
Facter.value(:domain),
].reject { |part| part.empty? }
].reject { |part| part.nil? || part.empty? }
external_hostname_parts.join(".")
end
end