From f3e0ab26988ee1ecd6fea6348e2954f97df6dd01 Mon Sep 17 00:00:00 2001 From: Michael Kerrin Date: Fri, 16 Aug 2013 16:39:59 +0000 Subject: [PATCH] Clean up the sqlalchemy migrate manage.py script. This way we can run it without figuring out passing in the correct url and repository information. Change-Id: Ib0f2c9d5c3888a1c094c8b636d735832a6242b7e --- cinder/db/sqlalchemy/migrate_repo/manage.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cinder/db/sqlalchemy/migrate_repo/manage.py b/cinder/db/sqlalchemy/migrate_repo/manage.py index 09e340f44..86ef0e600 100644 --- a/cinder/db/sqlalchemy/migrate_repo/manage.py +++ b/cinder/db/sqlalchemy/migrate_repo/manage.py @@ -1,4 +1,21 @@ #!/usr/bin/env python + +import os + +from oslo.config import cfg + +from cinder.openstack.common import gettextutils +gettextutils.install('cinder', lazy=True) + +from cinder.db.sqlalchemy import migrate_repo +from cinder.openstack.common.db.sqlalchemy import session +from cinder import version + from migrate.versioning.shell import main + +CONF = cfg.CONF + if __name__ == '__main__': - main(debug='False', repository='.') + CONF([], project='cinder', version=version.version_string()) + main(debug='False', url=CONF.database.connection, + repository=os.path.abspath(os.path.dirname(migrate_repo.__file__))) -- 2.45.2