added error output to get_ip

This commit is contained in:
Joel Klimont 2021-10-06 13:20:21 +02:00
parent 436ef35d46
commit 881f8ddbf8
5 changed files with 6 additions and 4 deletions

View file

@ -165,8 +165,9 @@ def get_ip():
try:
s.connect(('10.255.255.255', 1))
IP = s.getsockname()[0]
except Exception:
except Exception as e:
IP = '127.0.0.1'
print(f"Error could not query ip: {e}")
finally:
s.close()
return IP