Set global CONFIG variable

This commit is contained in:
Michel Oosterhof
2017-09-10 10:16:32 +04:00
parent 2d54278e85
commit f4c53a98db

View File

@ -10,7 +10,15 @@ from __future__ import division, absolute_import
import configparser
def readConfigFile(cfgfile):
config = configparser.ConfigParser()
config.read(cfgfile)
return config
"""
Read config files and return ConfigParser object
@param cfgfile: filename or array of filenames
@return: ConfigParser object
"""
parser = configparser.ConfigParser()
parser.read(cfgfile)
return parser
CONFIG = readConfigFile(("cowrie.cfg.dist", "etc/cowrie.cfg", "cowrie.cfg"))