diff options
author | sebres <serg.brester@sebres.de> | 2016-09-09 00:39:48 +0200 |
---|---|---|
committer | sebres <serg.brester@sebres.de> | 2016-09-09 10:45:09 +0200 |
commit | 8c4eebc3e315dd6b7602d8fbebf900947cf3e8f2 (patch) | |
tree | 1d521f4b5ba7e0a920d433afabb9899f08aedfe1 /fail2ban/server/actions.py | |
parent | 4fb511294e01d33e934c32b7d458088e19d42343 (diff) | |
download | fail2ban-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.py | 10 |
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( |