From f0625224c74b4ff134099d646526aa45aa4a271d Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Wed, 23 Feb 2005 17:47:30 +0000 Subject: [PATCH] - Added a default value for each option git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@72 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- confreader/configreader.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/confreader/configreader.py b/confreader/configreader.py index bd2aaba0d..dbdb5d2d3 100644 --- a/confreader/configreader.py +++ b/confreader/configreader.py @@ -34,9 +34,15 @@ class ConfigReader: Fail2Ban. Each other section is for a different log file. """ - optionValues = (["bool", "enabled"], ["str", "logfile"], - ["str", "timeregex"], ["str", "timepattern"], - ["str", "failregex"]) + # Each optionValues entry is composed of an array with: + # 0 -> the type of the option + # 1 -> the name of the option + # 2 -> the default value for the option + optionValues = (["bool", "enabled", True], + ["str", "logfile", "/dev/null"], + ["str", "timeregex", ""], + ["str", "timepattern", ""], + ["str", "failregex", ""]) def __init__(self, logSys, confPath): self.confPath = confPath @@ -70,6 +76,7 @@ class ConfigReader: values[option[1]] = v except NoOptionError: - self.logSys.info("No "+option+" defined in "+sec) + self.logSys.info("No '"+option[1]+"' defined in '"+sec+"'") + values[option[1]] = option[2] return values \ No newline at end of file