]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Clean up the sqlalchemy migrate manage.py script.
authorMichael Kerrin <michael.kerrin@hp.com>
Fri, 16 Aug 2013 16:39:59 +0000 (16:39 +0000)
committerMichael Kerrin <michael.kerrin@hp.com>
Wed, 21 Aug 2013 08:05:34 +0000 (08:05 +0000)
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

index 09e340f44f9380cde6a6f4b9351f07f4fcbf169b..86ef0e6002078a7daca86d53ccbf458e5da4eefb 100644 (file)
@@ -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__)))