summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSofer Athlan-Guyot <sathlang@redhat.com>2016-06-22 12:23:10 +0200
committerAthlan-Guyot sofer <sathlang@redhat.com>2016-07-11 09:25:37 +0000
commitedde5b9a28449f270d7813edca6f49aead4fb5a9 (patch)
treeddda0347faa09f56857db00b420dce377f042606 /lib
parentadc02fd625b6be1ee6529a4c7646e62d793a206a (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/facter/alt_fqdns.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/facter/alt_fqdns.rb b/lib/facter/alt_fqdns.rb
index 24d6ef1..8a4d59b 100644
--- a/lib/facter/alt_fqdns.rb
+++ b/lib/facter/alt_fqdns.rb
@@ -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