mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 07:46:07 -07:00
Catch failed hostname resolution (Fixes Tautulli/Tautulli-Issues#68)
This commit is contained in:
parent
aaf5a18251
commit
a915d2333f
1 changed files with 4 additions and 1 deletions
|
@ -1072,7 +1072,10 @@ def get_plexpy_url(hostname=None):
|
||||||
s.connect(('<broadcast>', 0))
|
s.connect(('<broadcast>', 0))
|
||||||
hostname = s.getsockname()[0]
|
hostname = s.getsockname()[0]
|
||||||
except socket.error:
|
except socket.error:
|
||||||
hostname = socket.gethostbyname(socket.gethostname())
|
try:
|
||||||
|
hostname = socket.gethostbyname(socket.gethostname())
|
||||||
|
except socket.gaierror:
|
||||||
|
pass
|
||||||
|
|
||||||
if not hostname:
|
if not hostname:
|
||||||
hostname = 'localhost'
|
hostname = 'localhost'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue