diff options
author | Ohad Levy <ohad.levy@infineon.com> | 2010-01-18 10:42:43 +0800 |
---|---|---|
committer | Paul Nasrat <pnasrat@googlemail.com> | 2010-03-08 22:36:01 +0000 |
commit | dca615c98b864d75e2ac5899d98d04a2bd979eba (patch) | |
tree | 115c4ac2454d5843a59331380ff37f0f8dac7867 /lib/facter/fqdn.rb | |
parent | 86447c884a47948a4ef6757ff7e7d2e0faf93ff5 (diff) | |
download | facter-dca615c98b864d75e2ac5899d98d04a2bd979eba.tar.gz facter-dca615c98b864d75e2ac5899d98d04a2bd979eba.tar.xz facter-dca615c98b864d75e2ac5899d98d04a2bd979eba.zip |
fixes #2573, #2085, #1291 - fixes domain and fqdn facts resolution
This patch removes the relationship between the domain fact and LDAP/NIS domains.
domain fact relates to DNS domain - this will avoid the confusion caused
by the LDAP/NIS domain (which might be different to the DNS domain name).
Additionally, if hostname is already in long form, it won't try to build
the fqdn fact from hostname and domain.
Diffstat (limited to 'lib/facter/fqdn.rb')
-rw-r--r-- | lib/facter/fqdn.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/facter/fqdn.rb b/lib/facter/fqdn.rb index 5ebc5f5..6271995 100644 --- a/lib/facter/fqdn.rb +++ b/lib/facter/fqdn.rb @@ -1,5 +1,9 @@ Facter.add(:fqdn) do setcode do + # try to fetch the fqdn from hostname if long hostname is used. + Facter.value(:hostname) + next $fqdn if defined? $fqdn and ! $fqdn.nil? + host = Facter.value(:hostname) domain = Facter.value(:domain) if host and domain |