From fc46ab7499e7b49d7a35a700063d34aed4ac39bb Mon Sep 17 00:00:00 2001 From: Alexander Georgievskiy Date: Tue, 6 Jun 2017 10:30:18 +0300 Subject: Fix mislogging unblocking as blocking --- dwt_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dwt_util.py b/dwt_util.py index 9ff098e..33f64f8 100644 --- a/dwt_util.py +++ b/dwt_util.py @@ -84,9 +84,9 @@ def ip_block(ip_list, undo): try: subprocess_handler(shlex.split(cmd)) - logger.info("IP Blocker: The IP {ip} was successfully blocked.".format(ip=ip)) + logger.info("IP Blocker: The IP {ip} was successfully {act}.".format(ip=ip, act='unblocked' if undo else 'blocked')) except CalledProcessError as e: - logger.exception("IP Blocker: Failed to block IP {ip}".format(ip=ip)) + logger.exception("IP Blocker: Failed to {act} IP {ip}".format(act='unblock' if undo else 'block', ip=ip)) logger.critical("IP Blocker: Error output:\n" + e.stdout.decode('ascii', 'replace')) -- cgit v1.2.3