summaryrefslogtreecommitdiff
path: root/fail2ban/server/actions.py
diff options
context:
space:
mode:
authorsebres <serg.brester@sebres.de>2016-09-09 00:39:48 +0200
committersebres <serg.brester@sebres.de>2016-09-09 10:45:09 +0200
commit8c4eebc3e315dd6b7602d8fbebf900947cf3e8f2 (patch)
tree1d521f4b5ba7e0a920d433afabb9899f08aedfe1 /fail2ban/server/actions.py
parent4fb511294e01d33e934c32b7d458088e19d42343 (diff)
downloadfail2ban-8c4eebc3e315dd6b7602d8fbebf900947cf3e8f2.tar.gz
reload actions amend, code review and test cases extended for update/start/stop of actions by reloading
Diffstat (limited to 'fail2ban/server/actions.py')
-rw-r--r--fail2ban/server/actions.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/fail2ban/server/actions.py b/fail2ban/server/actions.py
index 09b6823d..5ac7b9a9 100644
--- a/fail2ban/server/actions.py
+++ b/fail2ban/server/actions.py
@@ -430,15 +430,19 @@ class Actions(JailThread, Mapping):
Ticket of failures of which to unban
"""
if actions is None:
- actions = self._actions
+ unbactions = self._actions
+ else:
+ unbactions = actions
aInfo = dict()
aInfo["ip"] = ticket.getIP()
aInfo["failures"] = ticket.getAttempt()
aInfo["time"] = ticket.getTime()
aInfo["matches"] = "".join(ticket.getMatches())
- logSys.notice("[%s] Unban %s" % (self._jail.name, aInfo["ip"]))
- for name, action in actions.iteritems():
+ if actions is None:
+ logSys.notice("[%s] Unban %s", self._jail.name, aInfo["ip"])
+ for name, action in unbactions.iteritems():
try:
+ logSys.debug("[%s] action %r: unban %s", self._jail.name, name, aInfo["ip"])
action.unban(aInfo.copy())
except Exception as e:
logSys.error(