|
|
|
@ -103,7 +103,16 @@ class JailReader(ConfigReader):
|
|
|
|
|
logSys.warn("No actions were defined for %s" % self.__name) |
|
|
|
|
return True |
|
|
|
|
|
|
|
|
|
def convert(self): |
|
|
|
|
def convert(self, allow_no_files=False): |
|
|
|
|
"""Convert read before __opts to the commands stream |
|
|
|
|
|
|
|
|
|
Parameters |
|
|
|
|
---------- |
|
|
|
|
allow_missing : bool |
|
|
|
|
Either to allow log files to be missing entirely. Primarily is |
|
|
|
|
used for testing |
|
|
|
|
""" |
|
|
|
|
|
|
|
|
|
stream = [] |
|
|
|
|
for opt in self.__opts: |
|
|
|
|
if opt == "logpath": |
|
|
|
@ -115,7 +124,7 @@ class JailReader(ConfigReader):
|
|
|
|
|
for p in pathList: |
|
|
|
|
found_files += 1 |
|
|
|
|
stream.append(["set", self.__name, "addlogpath", p]) |
|
|
|
|
if not found_files: |
|
|
|
|
if not (found_files or allow_no_files): |
|
|
|
|
raise ValueError( |
|
|
|
|
"Have not found any log file for %s jail" % self.__name) |
|
|
|
|
elif opt == "backend": |
|
|
|
|