mirror of https://github.com/fail2ban/fail2ban
BF: Change name->actname for multi action jails to avoid clash
Primary examples is `name` is used in iptables actions for the chain. Also changed pop->get so actname can be used as keywordpull/189/head
parent
bec70cbe4b
commit
a3e216b0b2
|
@ -44,7 +44,7 @@ class ActionReader(DefinitionInitConfigReader):
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self, file_, jailName, initOpts, **kwargs):
|
def __init__(self, file_, jailName, initOpts, **kwargs):
|
||||||
self._name = initOpts.pop("name", file_)
|
self._name = initOpts.get("actname", file_)
|
||||||
DefinitionInitConfigReader.__init__(
|
DefinitionInitConfigReader.__init__(
|
||||||
self, file_, jailName, initOpts, **kwargs)
|
self, file_, jailName, initOpts, **kwargs)
|
||||||
|
|
||||||
|
|
|
@ -312,8 +312,8 @@ class JailsReaderTest(unittest.TestCase):
|
||||||
jailfd = open(os.path.join(basedir, "jail.conf"), 'w')
|
jailfd = open(os.path.join(basedir, "jail.conf"), 'w')
|
||||||
jailfd.write("""
|
jailfd.write("""
|
||||||
[testjail1]
|
[testjail1]
|
||||||
action = testaction1[name=test1]
|
action = testaction1[actname=test1]
|
||||||
testaction1[name=test2]
|
testaction1[actname=test2]
|
||||||
filter = testfilter1
|
filter = testfilter1
|
||||||
""")
|
""")
|
||||||
jailfd.close()
|
jailfd.close()
|
||||||
|
|
Loading…
Reference in New Issue