improve result for get/set prefregex

pull/2713/head
sebres 2020-08-26 16:54:18 +02:00
parent e569281d6b
commit d0d1f8c362
2 changed files with 7 additions and 2 deletions

View File

@ -277,7 +277,8 @@ class Transmitter:
value = command[2] value = command[2]
self.__server.setPrefRegex(name, value) self.__server.setPrefRegex(name, value)
if self.__quiet: return if self.__quiet: return
return self.__server.getPrefRegex(name) v = self.__server.getPrefRegex(name)
return v.getRegex() if v else ""
elif command[1] == "addfailregex": elif command[1] == "addfailregex":
value = command[2] value = command[2]
self.__server.addFailRegex(name, value, multiple=multiple) self.__server.addFailRegex(name, value, multiple=multiple)
@ -446,7 +447,8 @@ class Transmitter:
elif command[1] == "ignorecache": elif command[1] == "ignorecache":
return self.__server.getIgnoreCache(name) return self.__server.getIgnoreCache(name)
elif command[1] == "prefregex": elif command[1] == "prefregex":
return self.__server.getPrefRegex(name) v = self.__server.getPrefRegex(name)
return v.getRegex() if v else ""
elif command[1] == "failregex": elif command[1] == "failregex":
return self.__server.getFailRegex(name) return self.__server.getFailRegex(name)
elif command[1] == "ignoreregex": elif command[1] == "ignoreregex":

View File

@ -513,6 +513,9 @@ class Transmitter(TransmitterBase):
jail=self.jailName) jail=self.jailName)
self.setGetTest("ignorecache", '', None, jail=self.jailName) self.setGetTest("ignorecache", '', None, jail=self.jailName)
def testJailPrefRegex(self):
self.setGetTest("prefregex", "^Test", jail=self.jailName)
def testJailRegex(self): def testJailRegex(self):
self.jailAddDelRegexTest("failregex", self.jailAddDelRegexTest("failregex",
[ [