Skip to content

Commit bbd0ae0

Browse files
author
Oana Tanasoiu
committed
(maint) Fix fqdn on JRuby
Skip resolving fqdn with Socket.getaddrinfo when the method returns an ip instead of a valid fqdn
1 parent 8dffc51 commit bbd0ae0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/facter/resolvers/hostname_resolver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def retrieve_with_addrinfo(host)
4848
@log.debug("Socket.getaddrinfo failed to retrieve fqdn for hostname #{host} with: #{e}")
4949
return
5050
end
51-
return if name.nil? || name.empty? || host == name[2]
51+
return if name.nil? || name.empty? || host == name[2] || name[2] == name[3]
5252

5353
name[2]
5454
end

0 commit comments

Comments
 (0)