mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-11-08 02:41:59 +01:00
pilerpurge.py should honor the mysqlhost value
Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
parent
37dc6058ce
commit
704030b282
@ -24,6 +24,11 @@ def read_options(filename="", opts={}):
|
|||||||
config = configparser.ConfigParser()
|
config = configparser.ConfigParser()
|
||||||
config.read_string(s)
|
config.read_string(s)
|
||||||
|
|
||||||
|
if config.has_option('piler', 'mysqlhost'):
|
||||||
|
opts['dbhost'] = config.get('piler', 'mysqlhost')
|
||||||
|
else:
|
||||||
|
opts['dbhost'] = 'localhost'
|
||||||
|
|
||||||
opts['username'] = config.get('piler', 'mysqluser')
|
opts['username'] = config.get('piler', 'mysqluser')
|
||||||
opts['password'] = config.get('piler', 'mysqlpwd')
|
opts['password'] = config.get('piler', 'mysqlpwd')
|
||||||
opts['database'] = config.get('piler', 'mysqldb')
|
opts['database'] = config.get('piler', 'mysqldb')
|
||||||
@ -190,7 +195,7 @@ def main():
|
|||||||
|
|
||||||
read_options(args.config, opts)
|
read_options(args.config, opts)
|
||||||
try:
|
try:
|
||||||
opts['db'] = dbapi.connect("localhost", opts['username'],
|
opts['db'] = dbapi.connect(opts['dbhost'], opts['username'],
|
||||||
opts['password'], opts['database'])
|
opts['password'], opts['database'])
|
||||||
|
|
||||||
if is_purge_enabled(opts) is False:
|
if is_purge_enabled(opts) is False:
|
||||||
|
Loading…
Reference in New Issue
Block a user