mirror of https://github.com/fail2ban/fail2ban
filter reader stream: don't need to generate None values from filter config
parent
b83712e3ec
commit
c6e93db278
|
@ -72,8 +72,9 @@ class FilterReader(DefinitionInitConfigReader):
|
|||
def _fillStream(stream, opts, jailName):
|
||||
prio0idx = 0
|
||||
for opt, value in opts.iteritems():
|
||||
if opt in ("failregex", "ignoreregex"):
|
||||
# Do not send a command if the value is not set (empty).
|
||||
if value is None: continue
|
||||
if opt in ("failregex", "ignoreregex"):
|
||||
multi = []
|
||||
for regex in value.split('\n'):
|
||||
# Do not send a command if the rule is empty.
|
||||
|
@ -91,8 +92,6 @@ class FilterReader(DefinitionInitConfigReader):
|
|||
elif opt in ('datepattern'):
|
||||
stream.append(["set", jailName, opt, value])
|
||||
elif opt == 'journalmatch':
|
||||
# Do not send a command if the match is empty.
|
||||
if value is None: continue
|
||||
for match in value.split("\n"):
|
||||
if match == '': continue
|
||||
stream.append(
|
||||
|
|
Loading…
Reference in New Issue