Logo Search packages:      
Sourcecode: fail2ban version File versions  Download package

def confreader::configreader::ConfigReader::getLogOptions (   self,
  sec,
  options 
)

Gets all the options of a given section. The options
      are defined in the optionValues list.

Definition at line 62 of file configreader.py.

00062                                            :
            """ Gets all the options of a given section. The options
                  are defined in the optionValues list.
            """
            values = dict()
            for option in options:
                  try:
                        if option[0] == "bool":
                              v = self.configParser.getboolean(sec, option[1])
                        elif option[0] == "int":
                              v = self.configParser.getint(sec, option[1])
                        else:
                              v = self.configParser.get(sec, option[1])
                        
                        values[option[1]] = v
                  except NoOptionError:
                        logSys.warn("No '" + option[1] + "' defined in '" + sec + "'")
                        values[option[1]] = option[2]
                  except ValueError:
                        logSys.warn("Wrong value for '" + option[1] + "' in '" + sec +
                                          "'. Using default one: '" + `option[2]` + "'")
                        values[option[1]] = option[2]
            return values
            


Generated by  Doxygen 1.6.0   Back to index