better logging

This commit is contained in:
Stefan Midjich 2017-11-16 23:55:53 +01:00
parent f56eb9a83d
commit 82b5e46159

View file

@ -57,7 +57,9 @@ def run(arg):
try: try:
socket.inet_aton(client_ip) socket.inet_aton(client_ip)
except socket.error: except socket.error:
l.error('Client IP-address is invalid') l.error('Client ip:{ip} is invalid'.format(
ip=repr(client_ip)
))
return { return {
'error': str(e), 'error': str(e),
'failed': True 'failed': True
@ -109,7 +111,9 @@ def run(arg):
raise raise
if rc.exit_code == 0: if rc.exit_code == 0:
l.debug('Created iptables IP rule successfully') l.debug('Created iptables rule for client:{ip}'.format(
ip=client_ip
))
# If all else fails, error! This will be shown to end users. # If all else fails, error! This will be shown to end users.
return { return {