mirror of https://github.com/fail2ban/fail2ban
fixed introduced by me problem - we should wrap each call
parent
f3da148d0f
commit
14fbb34e51
13
fail2ban.py
13
fail2ban.py
|
@ -112,11 +112,16 @@ def restoreFwRules():
|
|||
""" Flush the ban list
|
||||
"""
|
||||
logSys.warn("Restoring firewall rules...")
|
||||
try:
|
||||
for element in logFwList:
|
||||
# Execute end command of each section
|
||||
element[2].flushBanList(conf["debug"])
|
||||
for element in logFwList:
|
||||
# Execute end command of each section
|
||||
try:
|
||||
element[2].restore(conf["debug"])
|
||||
except ExternalError:
|
||||
# nothing bad really - we can survive :-)
|
||||
# but it has to be a separate exception handler
|
||||
# for each section, so we don't miss anything
|
||||
pass
|
||||
try:
|
||||
# Execute global end command
|
||||
executeCmd(conf["cmdend"], conf["debug"])
|
||||
except ExternalError:
|
||||
|
|
|
@ -53,6 +53,7 @@ class Firewall:
|
|||
|
||||
def restore(self, debug):
|
||||
logSys.debug("Restore firewall rules")
|
||||
flushBanList(debug)
|
||||
executeCmd(self.endRule, debug)
|
||||
|
||||
def addBanIP(self, aInfo, debug):
|
||||
|
|
Loading…
Reference in New Issue