mirror of
https://github.com/cowrie/cowrie.git
synced 2025-07-01 18:07:27 -04:00
Set global CONFIG variable
This commit is contained in:
@ -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"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user