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

@ -34,7 +34,7 @@ fpm -s python --python-bin python3 --python-pip pip3 --python-package-name-prefi
-d "python3-pigpio" \
-d "python3-numpy" \
-d "ffmpeg" \
-v 0.2.6-0 -t deb setup.py
-v 0.2.6-1 -t deb setup.py
# --deb-changelog changelog \
# --deb-upstream-changelog changelog \

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

View file

@ -48,6 +48,7 @@ def get_ip():
IP = s.getsockname()[0]
except Exception:
IP = '127.0.0.1'
print(f"Error could not query ip: {e}")
finally:
s.close()
return IP

View file

@ -1,4 +1,4 @@
__version__ = "0.2.6-0"
__version__ = "0.2.6-1"
import importlib
import compLib.LogstashLogging

View file

@ -12,7 +12,7 @@ else:
setuptools.setup(
name="complib",
version="0.2.6-0",
version="0.2.6-1",
author="F-WuTs",
author_email="--",
description="",