BF: corrected tests for missing jail

Previously tests relied on the missing filter to trigger the conditions
required for a missing jail. We now handle this explicitly.
pull/484/head
Daniel Black 11 years ago
parent 3ddf8da76e
commit d74dd31d23

@ -112,7 +112,7 @@ class ConfigReader(SafeConfigParserWithIncludes):
except NoSectionError, e:
# No "Definition" section or wrong basedir
logSys.error(e)
values[option[1]] = option[2]
return False
except NoOptionError:
if not option[2] is None:
logSys.warn("'%s' not defined in '%s'. Using default one: %r"

@ -54,7 +54,7 @@ class JailReader(ConfigReader):
return ConfigReader.read(self, "jail")
def isEnabled(self):
return self.__force_enable or self.__opts["enabled"]
return self.__force_enable or ( self.__opts and self.__opts["enabled"] )
@staticmethod
def _glob(path):
@ -84,6 +84,8 @@ class JailReader(ConfigReader):
["string", "filter", ""],
["string", "action", ""]]
self.__opts = ConfigReader.getOptions(self, self.__name, opts)
if not self.__opts:
return False
if self.isEnabled():
# Read filter

Loading…
Cancel
Save