Bug 1022653

Summary: RDO-grizzly quantum-db-manage fails
Product: [Community] RDO Reporter: Dan Smith <dasmith>
Component: openstack-quantumAssignee: RHOS Maint <rhos-maint>
Status: CLOSED NOTABUG QA Contact: Ofer Blaut <oblaut>
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: chrisw, lars, yeylon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-23 20:27:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Smith 2013-10-23 17:50:27 UTC
Description of problem:

quantum-db-manage fails with a stack trace

Version-Release number of selected component (if applicable):

openstack-quantum-2013.1.3-1.el6.noarch

How reproducible:

Always

Steps to Reproduce:
1. Install RDO-grizzly
2. Install packstack
3. Run packstack --allinone
4. Run "quantum-db-manage upgrade head"

Actual results:

Stack trace:

[root@centos2 ~]# quantum-db-manage upgrade head
Traceback (most recent call last):
  File "/usr/bin/quantum-db-manage", line 26, in <module>
    main()
  File "/usr/lib/python2.6/site-packages/quantum/db/migration/cli.py", line 137, in main
    CONF.command.func(config, CONF.command.name)
  File "/usr/lib/python2.6/site-packages/quantum/db/migration/cli.py", line 76, in do_upgrade_downgrade
    do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
  File "/usr/lib/python2.6/site-packages/quantum/db/migration/cli.py", line 55, in do_alembic_command
    getattr(alembic_command, cmd)(config, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/alembic/command.py", line 124, in upgrade
    script.run_env()
  File "/usr/lib/python2.6/site-packages/alembic/script.py", line 191, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/usr/lib/python2.6/site-packages/alembic/util.py", line 186, in load_python_file
    module = imp.load_source(module_id, path, open(path, 'rb'))
  File "/usr/lib/python2.6/site-packages/quantum/db/migration/alembic_migrations/env.py", line 39, in <module>
    plugin_klass = importutils.import_class(quantum_config.core_plugin)
  File "/usr/lib/python2.6/site-packages/quantum/openstack/common/importutils.py", line 35, in import_class
    traceback.format_exception(*sys.exc_info())))
ImportError: Class  cannot be found (['Traceback (most recent call last):\n', '  File "/usr/lib/python2.6/site-packages/quantum/openstack/common/importutils.py", line 30, in import_class\n    __import__(mod_str)\n', 'ValueError: Empty module name\n'])

Expected results:

No stack trace, and schema upgraded (if needed)

Additional info:

[root@centos2 ~]# grep plugin /etc/quantum/quantum.conf 
# Quantum plugin provider module
# core_plugin =
core_plugin =quantum.plugins.openvswitch.ovs_quantum_plugin.OVSQuantumPluginV2
# service_plugins =
# <service>:<plugin>[:driver]

Comment 1 Lars Kellogg-Stedman 2013-10-23 20:11:56 UTC
Running:

    quantum-db-manage --config-file /etc/quantum/quantum.conf --config-file /etc/quantum/plugin.ini upgrade head

will avoid that error.  But note that you will need to run the "stamp" command first for it to be successful:

    quantum-db-manage --config-file /etc/quantum/quantum.conf --config-file /etc/quantum/plugin.ini stamp grizzly

Comment 2 Dan Smith 2013-10-23 20:27:02 UTC
Yep, meant to close this after I figured it out, thanks.