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
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__)))