neutron-db-manage current/history/branches/stamp/revision is broken

Bug #1353180 reported by Ronak Shah
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Ronak Shah

Bug Description

In order to fix bug (https://bugs.launchpad.net/neutron/+bug/1288358) following commit was made https://review.openstack.org/#/c/81334.

That has introduce a problem where neutron-db-manage does not work with some of the options.
For example:
root@openstack-ubuntu:/opt/stack/neutron# neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file <X> --config-file <Y> current
Traceback (most recent call last):
  File "/usr/local/bin/neutron-db-manage", line 10, in <module>
    sys.exit(main())
  File "/opt/stack/neutron/neutron/db/migration/cli.py", line 175, in main
    CONF.command.func(config, CONF.command.name)
  File "/opt/stack/neutron/neutron/db/migration/cli.py", line 63, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 233, in current
    script.run_env()
  File "/usr/local/lib/python2.7/dist-packages/alembic/script.py", line 203, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/local/lib/python2.7/dist-packages/alembic/util.py", line 212, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/local/lib/python2.7/dist-packages/alembic/compat.py", line 58, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py", line 125, in <module>
    run_migrations_online()
  File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py", line 94, in run_migrations_online
    set_mysql_engine(neutron_config.command.mysql_engine)
  File "/usr/local/lib/python2.7/dist-packages/oslo/config/cfg.py", line 2344, in __getattr__
    raise NoSuchOptError(name)
oslo.config.cfg.NoSuchOptError: no such option: mysql_engine

root@openstack-ubuntu:/opt/stack/neutron# neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file <X> --config-file <Y> stamp icehouse
Traceback (most recent call last):
  File "/usr/local/bin/neutron-db-manage", line 10, in <module>
    sys.exit(main())
  File "/opt/stack/neutron/neutron/db/migration/cli.py", line 175, in main
    CONF.command.func(config, CONF.command.name)
  File "/opt/stack/neutron/neutron/db/migration/cli.py", line 91, in do_stamp
    sql=CONF.command.sql)
  File "/opt/stack/neutron/neutron/db/migration/cli.py", line 63, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/alembic/command.py", line 258, in stamp
    script.run_env()
  File "/usr/local/lib/python2.7/dist-packages/alembic/script.py", line 203, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/local/lib/python2.7/dist-packages/alembic/util.py", line 212, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/local/lib/python2.7/dist-packages/alembic/compat.py", line 58, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py", line 125, in <module>
    run_migrations_online()
  File "/opt/stack/neutron/neutron/db/migration/alembic_migrations/env.py", line 94, in run_migrations_online
    set_mysql_engine(neutron_config.command.mysql_engine)
  File "/usr/local/lib/python2.7/dist-packages/oslo/config/cfg.py", line 2344, in __getattr__
    raise NoSuchOptError(name)
oslo.config.cfg.NoSuchOptError: no such option: mysql_engine

Tags: db
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/112171

Changed in neutron:
assignee: nobody → Ronak Shah (ronak-malav-shah)
status: New → In Progress
Akihiro Motoki (amotoki)
tags: added: db
Changed in neutron:
importance: Undecided → High
milestone: none → juno-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/112171
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=01b2eedd05fb91aa8970c64b753d831257243598
Submitter: Jenkins
Branch: master

commit 01b2eedd05fb91aa8970c64b753d831257243598
Author: ronak <email address hidden>
Date: Tue Aug 5 17:40:24 2014 -0700

    Fixing neutron-db-manage with some options other than upgrade/downgrade

    "mysql-engine" argument was added to upgrade and downgrade option of
    neutron-db-manage.
    Reference commit: http://tinyurl.com/mzepbmq

    migration environment's run_migration_offline/online() gets called
    even for other neutron-db-manage options as well such as current,
    history, stamp, branches etc. For those options since the argument
    can not be set, it throws oslo.config.cfg.NoSuchOptError.
    This fix tries to catch it and set the value accordingly.

    Closes-bug: #1353180

    Change-Id: I044daf04216ec61245ddb51689f8e50be5666e34

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-3 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.