BF: allow processing with empty filter

pull/484/head
Daniel Black 2013-12-13 11:36:00 +00:00
parent 2f3648c458
commit b147270be7
1 changed files with 3 additions and 1 deletions

View File

@ -99,6 +99,7 @@ class JailReader(ConfigReader):
logSys.error("Unable to read the filter") logSys.error("Unable to read the filter")
return False return False
else: else:
self.__filter = None
logSys.warn("No filter set for jail %s" % self.__name) logSys.warn("No filter set for jail %s" % self.__name)
# Read action # Read action
@ -168,7 +169,8 @@ class JailReader(ConfigReader):
# Do not send a command if the rule is empty. # Do not send a command if the rule is empty.
if regex != '': if regex != '':
stream.append(["set", self.__name, "addignoreregex", regex]) stream.append(["set", self.__name, "addignoreregex", regex])
stream.extend(self.__filter.convert()) if self.__filter:
stream.extend(self.__filter.convert())
for action in self.__actions: for action in self.__actions:
stream.extend(action.convert()) stream.extend(action.convert())
stream.insert(0, ["add", self.__name, backend]) stream.insert(0, ["add", self.__name, backend])