From: Mathieu Gagné Date: Thu, 7 Aug 2014 23:21:49 +0000 (-0400) Subject: Make manage.py usable X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=186c3e99cf04b22ddbb1046cc9e42d1f7473e8cf;p=openstack-build%2Fcinder-build.git Make manage.py usable It's not possible to use manage.py in its current state due to an exception thrown by oslo.config: oslo.config.cfg.ArgsAlreadyParsedError: arguments already parsed: cannot register CLI option This exception is a side-effect of including cinder.openstack.common.logging in most of the migration scripts. This change therefore suggests removing oslo.config and other imports from manage.py to make it usable again. It is now possible to use manage.py: tox -evenv -- python cinder/db/sqlalchemy/migrate_repo/manage.py \ version_control --url=sqlite:///./cinder.db tox -evenv -- python cinder/db/sqlalchemy/migrate_repo/manage.py \ upgrade --url=sqlite:///./cinder.db Closes-bug: #1355297 Change-Id: I843cfa9a4e4758a6bc8e5c04f064e9d3107b01fa --- diff --git a/cinder/db/sqlalchemy/migrate_repo/manage.py b/cinder/db/sqlalchemy/migrate_repo/manage.py index d12e89188..22877d940 100755 --- a/cinder/db/sqlalchemy/migrate_repo/manage.py +++ b/cinder/db/sqlalchemy/migrate_repo/manage.py @@ -15,19 +15,11 @@ import os -from oslo.config import cfg - -from cinder import i18n -i18n.enable_lazy() - from cinder.db.sqlalchemy import migrate_repo -from cinder import version from migrate.versioning.shell import main -CONF = cfg.CONF if __name__ == '__main__': - CONF([], project='cinder', version=version.version_string()) - main(debug='False', url=CONF.database.connection, + main(debug='False', repository=os.path.abspath(os.path.dirname(migrate_repo.__file__)))