Config for MySQL

This commit is contained in:
Simon 2020-09-25 12:15:14 +01:00
parent d79c8e053e
commit 01efd09a09
2 changed files with 12 additions and 0 deletions

View File

@ -108,6 +108,7 @@ def build_config(_config_file):
CONFIG['LOGGER'] = {}
CONFIG['ALIASES'] = {}
CONFIG['SYSTEMS'] = {}
CONFIG['MYSQL'] = {}
try:
for section in config.sections():
@ -153,6 +154,17 @@ def build_config(_config_file):
'STALE_TIME': config.getint(section, 'STALE_DAYS') * 86400,
})
elif section == 'MYSQL':
CONFIG['MYSQL'].update({
'USE_MYSQL': config.getboolean(section, 'USE_MYSQL'),
'USER': config.get(section, 'USER'),
'PASS': config.get(section, 'PASS'),
'DB': config.get(section, 'DB'),
'SERVER': config.get(section, 'SERVER'),
'PORT': config.getint('PORT')
})
elif config.getboolean(section, 'ENABLED'):
if config.get(section, 'MODE') == 'PEER':
CONFIG['SYSTEMS'].update({section: {

0
mysql.py Normal file
View File