mirror of https://github.com/fail2ban/fail2ban
improve result for get/set prefregex
parent
e569281d6b
commit
d0d1f8c362
|
@ -277,7 +277,8 @@ class Transmitter:
|
|||
value = command[2]
|
||||
self.__server.setPrefRegex(name, value)
|
||||
if self.__quiet: return
|
||||
return self.__server.getPrefRegex(name)
|
||||
v = self.__server.getPrefRegex(name)
|
||||
return v.getRegex() if v else ""
|
||||
elif command[1] == "addfailregex":
|
||||
value = command[2]
|
||||
self.__server.addFailRegex(name, value, multiple=multiple)
|
||||
|
@ -446,7 +447,8 @@ class Transmitter:
|
|||
elif command[1] == "ignorecache":
|
||||
return self.__server.getIgnoreCache(name)
|
||||
elif command[1] == "prefregex":
|
||||
return self.__server.getPrefRegex(name)
|
||||
v = self.__server.getPrefRegex(name)
|
||||
return v.getRegex() if v else ""
|
||||
elif command[1] == "failregex":
|
||||
return self.__server.getFailRegex(name)
|
||||
elif command[1] == "ignoreregex":
|
||||
|
|
|
@ -513,6 +513,9 @@ class Transmitter(TransmitterBase):
|
|||
jail=self.jailName)
|
||||
self.setGetTest("ignorecache", '', None, jail=self.jailName)
|
||||
|
||||
def testJailPrefRegex(self):
|
||||
self.setGetTest("prefregex", "^Test", jail=self.jailName)
|
||||
|
||||
def testJailRegex(self):
|
||||
self.jailAddDelRegexTest("failregex",
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue