bug #1462706: guard against host not having FQDN hostname
This commit is contained in:
parent
31fe35bdee
commit
4eb521e595
|
@ -1130,8 +1130,11 @@ class FileHandler(BaseHandler):
|
||||||
names = None
|
names = None
|
||||||
def get_names(self):
|
def get_names(self):
|
||||||
if FileHandler.names is None:
|
if FileHandler.names is None:
|
||||||
FileHandler.names = (socket.gethostbyname('localhost'),
|
try:
|
||||||
socket.gethostbyname(socket.gethostname()))
|
FileHandler.names = (socket.gethostbyname('localhost'),
|
||||||
|
socket.gethostbyname(socket.gethostname()))
|
||||||
|
except socket.gaierror:
|
||||||
|
FileHandler.names = (socket.gethostbyname('localhost'),)
|
||||||
return FileHandler.names
|
return FileHandler.names
|
||||||
|
|
||||||
# not entirely sure what the rules are here
|
# not entirely sure what the rules are here
|
||||||
|
|
Loading…
Reference in New Issue