From 27947407bc7910f0f50972113218ebc73c4a22c7 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 21 Jun 2013 11:08:27 -0400 Subject: [PATCH] ENH: raise an exception if not a single file was found for the jail. Close #63 --- client/jailreader.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/jailreader.py b/client/jailreader.py index f8757e26..ef444125 100644 --- a/client/jailreader.py +++ b/client/jailreader.py @@ -107,12 +107,17 @@ class JailReader(ConfigReader): stream = [] for opt in self.__opts: if opt == "logpath": + found_files = 0 for path in self.__opts[opt].split("\n"): pathList = glob.glob(path) if len(pathList) == 0: - logSys.error("No file found for " + path) + logSys.error("No file(s) found for glob %s" % path) for p in pathList: + found_files += 1 stream.append(["set", self.__name, "addlogpath", p]) + if not found_files: + raise ValueError( + "Have not found any log file for %s jail" % self.__name) elif opt == "backend": backend = self.__opts[opt] elif opt == "maxretry":