[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] daklib/utils.py: use socket.getfqdn() to determine the hostname



On 12035 March 1977, Philipp Kern wrote:

> The current socket.gethostbyaddr(socket.gethostname()) fails horribly on
> our IPv6 enabled machine.

Really?

host chopin.debian.org:
chopin.debian.org has address 195.20.242.124
chopin.debian.org has IPv6 address 2001:8d8:2:1:6564:a62:0:3


Python 2.5.2 (r252:60911, Jan 24 2010, 17:44:40) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostbyaddr(socket.gethostname())
('chopin.debian.org', ['chopin'], ['195.20.242.124'])
>>> socket.getfqdn()
'chopin.debian.org'
>>> 

Or do you have a v6 only host?

Im not really against applying this patch, it seems to work from a quick
test, I just don't see it failing.

-- 
bye, Joerg
Some NM:
graphviz: ouch, that license is hard to read, damn lawyer gibberish.


Reply to: