Commit dc87e579 authored by Aleksey Shirokih's avatar Aleksey Shirokih
Browse files

Migrate db settings

parent 9ff39ccf
......@@ -67,7 +67,8 @@ def migrate(migrator):
'influxdb',
'clickhouse',
'consultemplate',
'monitoring'
'monitoring',
'consul-template'
)
backaped_services = (
'discovery',
......@@ -203,7 +204,27 @@ def migrate(migrator):
if srv.service in consul_template_depend_srv:
ct_promote_nodes.add(srv.node)
if srv.service == 'grafana':
conf['pg_password'] = conf['password']
del conf['password']
if srv.service == 'mongod':
conf['db'] = conf['mongod_db']
del conf['mongod_db']
conf['engine'] = conf['mongod_engine']
del conf['mongod_engine']
conf['password'] = conf['mongod_password']
del conf['mongod_password']
conf['rs'] = conf['mongod_rs']
del conf['mongod_rs']
conf['user'] = conf['mongod_user']
del conf['mongod_user']
if srv.service == 'postgres':
conf['noc_db'] = conf['postgres_db']
del conf['postgres_db']
conf['noc_password'] = conf['postgres_password']
del conf['postgres_password']
conf['noc_user'] = conf['postgres_user']
del conf['postgres_user']
conf["loglevel"] = srv.loglevel
srv.config = json.dumps(conf, sort_keys=True)
srv.save()
......@@ -231,7 +252,6 @@ def migrate(migrator):
config=json.dumps({}, sort_keys=True)
).save()
migrator.drop_column(
"service",
"n_instances"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment