BF: Skip error in jail reader when no log files and with systemd backend

Updated to avoid logpath elements entirely
pull/277/head
Steven Hiscocks 2013-06-30 00:50:15 +01:00
parent 1aee817be2
commit 8513fde92a
1 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,8 @@ class JailReader(ConfigReader):
stream = [] stream = []
for opt in self.__opts: for opt in self.__opts:
if opt == "logpath": if opt == "logpath" and \
self.__opts.get('backend', None) != "systemd":
found_files = 0 found_files = 0
for path in self.__opts[opt].split("\n"): for path in self.__opts[opt].split("\n"):
pathList = glob.glob(path) pathList = glob.glob(path)
@ -136,8 +137,7 @@ class JailReader(ConfigReader):
for p in pathList: for p in pathList:
found_files += 1 found_files += 1
stream.append(["set", self.__name, "addlogpath", p]) stream.append(["set", self.__name, "addlogpath", p])
if not (found_files or allow_no_files or if not (found_files or allow_no_files):
self.__opts.get('backend', None) == "systemd"):
raise ValueError( raise ValueError(
"Have not found any log file for %s jail" % self.__name) "Have not found any log file for %s jail" % self.__name)
elif opt == "logencoding": elif opt == "logencoding":