mirror of
https://codeberg.org/prof_x_pvt_ltd/captive.whump.shanti-portal
synced 2024-08-14 22:46:42 +00:00
better logging
This commit is contained in:
parent
f56eb9a83d
commit
82b5e46159
1 changed files with 6 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue