fixed an issue with command line parameters

debian-releases/etch
Yaroslav Halchenko 2005-10-15 05:14:56 +00:00
parent f2136c09d5
commit ac5242815f
3 changed files with 16 additions and 2 deletions

View File

@ -55,6 +55,12 @@ class ConfigReader:
logSys.debug("Found sections: " + `sections`)
return sections
def setValue(self, sec, label, value):
""" Override a value for a section
"""
self.configParser.set(sec, label, value)
# Each optionValues entry is composed of an array with:
# 0 -> the type of the option
# 1 -> the name of the option

3
debian/changelog vendored
View File

@ -16,7 +16,8 @@ fail2ban (0.5.4-5.11) unstable; urgency=low
case if check of fwban or fwban command failed (closes: #329163, #331695).
(Introduced patch was further adjusted by upstream author)
* Added -f command line parameter for [findtime]
* Fixing the issue of not respecting command line parameters
* Fixed the issue of not respecting command line parameters for parameters
within sections
-- Yaroslav Halchenko <debian@onerussian.com> Mon, 3 Oct 2005 22:26:28 -1000

View File

@ -229,6 +229,13 @@ def main():
# Gets command line options
getCmdLineOptions(optList)
# Now we need to update confReader.configParser with 'commandline'
# overwritten parameters. There is no way to assign configParser
# with defaults (as I thought before) below in the code: thus defaults
# have to be overridden
for t, label, v in optionValues:
confReader.setValue("DEFAULT", label, `conf[label]`)
# PID lock
pidLock.setPath(conf["pidlock"])