Merge "Fix coverage2sql-db-manage to read config"
This commit is contained in:
commit
79b9482238
|
@ -38,7 +38,8 @@ def setup():
|
||||||
|
|
||||||
pool_size = CONF.database.max_pool_size
|
pool_size = CONF.database.max_pool_size
|
||||||
pool_recycle = CONF.database.idle_timeout
|
pool_recycle = CONF.database.idle_timeout
|
||||||
if not pool_size and not pool_recycle:
|
if db_uri.get_backend_name() == 'sqlite' or (not pool_size
|
||||||
|
and not pool_recycle):
|
||||||
engine = create_engine(db_uri)
|
engine = create_engine(db_uri)
|
||||||
else:
|
else:
|
||||||
engine = create_engine(db_uri,
|
engine = create_engine(db_uri,
|
||||||
|
|
|
@ -23,6 +23,7 @@ from alembic import util as alembic_util
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from coverage2sql.db import api as db_api
|
from coverage2sql.db import api as db_api
|
||||||
|
from coverage2sql import shell
|
||||||
|
|
||||||
HEAD_FILENAME = 'HEAD'
|
HEAD_FILENAME = 'HEAD'
|
||||||
|
|
||||||
|
@ -177,7 +178,9 @@ def main():
|
||||||
config.set_main_option('script_location',
|
config.set_main_option('script_location',
|
||||||
'coverage2sql:migrations')
|
'coverage2sql:migrations')
|
||||||
config.coverage2sql_config = CONF
|
config.coverage2sql_config = CONF
|
||||||
|
CONF.register_cli_opts(shell.DATABASE_OPTS, group='database')
|
||||||
CONF()
|
CONF()
|
||||||
|
db_api.get_session()
|
||||||
CONF.command.func(config, CONF.command.name)
|
CONF.command.func(config, CONF.command.name)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in New Issue