Fix how migration's cli register db connection opt
It's not good to duplicate the same oslo.config options in one project due to the fact that it'll be hadled incorrectly by different config sample generation tools. The better option is to use CONF.import_opt that will import oslo/db/sqla/session that already registers db connection option with good description and backward compatibility support. Change-Id: I71c4c0442464f2b4e88fb172f5d5e23daa133834
This commit is contained in:
parent
32ec2593ea
commit
db139dec8d
@ -21,13 +21,9 @@ from alembic import util as alembic_u
|
||||
from oslo.config import cfg
|
||||
|
||||
|
||||
_db_opts = [
|
||||
cfg.StrOpt('connection', default='', deprecated_name='sql_connection',
|
||||
help='URL to database')
|
||||
]
|
||||
|
||||
CONF = cfg.ConfigOpts()
|
||||
CONF.register_opts(_db_opts, 'database')
|
||||
CONF = cfg.CONF
|
||||
CONF.import_opt("connection", "savanna.openstack.common.db.sqlalchemy.session",
|
||||
group="database")
|
||||
|
||||
|
||||
def do_alembic_command(config, cmd, *args, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user