Deal with openbsd's different style of default /etc/hosts by forcing the fqdn

lookup to use the IP address returned by gethosbyname.
This commit is contained in:
Anthony Baxter 2006-04-03 08:10:33 +00:00
parent 93f5b93422
commit cf0a2a8576
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ class GeneralModuleTests(unittest.TestCase):
# Probably a similar problem as above; skip this test # Probably a similar problem as above; skip this test
return return
all_host_names = [hostname, hname] + aliases all_host_names = [hostname, hname] + aliases
fqhn = socket.getfqdn() fqhn = socket.getfqdn(ip)
if not fqhn in all_host_names: if not fqhn in all_host_names:
self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names))) self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqhn, repr(all_host_names)))