No module named openstack.common.db

Bug #1303579 reported by Ian Wienand
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo-incubator
Fix Released
Low
Ian Wienand

Bug Description

Seeing error importing openstack.common.db

---
$ ./run_tests.sh

[time passes]

Cleaning up...

    OpenStack development environment setup is complete.

    OpenStack development uses virtualenv to track and manage Python
    dependencies while in development and testing.

    To activate the OpenStack virtualenv for the extent of your current shell
    session you can run:

    $ source /home/iwienand/programs/oslo-incubator/.venv/bin/activate

    Or, if you prefer, you can run commands in the virtualenv on a case by case
    basis by running:

    $ /home/iwienand/programs/oslo-incubator/tools/with_venv.sh <your command>

    Also, make test will automatically use the virtualenv.

Running `/home/iwienand/programs/oslo-incubator/tools/with_venv.sh python setup.py testr --testr-args='--concurrency=1 --subunit '`
Traceback (most recent call last):
  File "./openstack/common/db/sqlalchemy/provision.py", line 27, in <module>
    from openstack.common.db import exception as exc
ImportError: No module named openstack.common.db
Traceback (most recent call last):
  File "./openstack/common/db/sqlalchemy/provision.py", line 27, in <module>
    from openstack.common.db import exception as exc
ImportError: No module named openstack.common.db
Disposing of instances failed, return 1
error: testr failed (3)
---

this is because it's trying to call python on the script directly to instantiate the database

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

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

Changed in oslo:
assignee: nobody → Ian Wienand (iwienand)
status: New → In Progress
Revision history for this message
Roman Podoliaka (rpodolyaka) wrote :

Setting this to low, as we don't really use run_tests.sh anymore.

Changed in oslo:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo-incubator (master)

Reviewed: https://review.openstack.org/85634
Committed: https://git.openstack.org/cgit/openstack/oslo-incubator/commit/?id=2ae2377ba16bab61cd1859d89f04d5a798ac6a08
Submitter: Jenkins
Branch: master

commit 2ae2377ba16bab61cd1859d89f04d5a798ac6a08
Author: Ian Wienand <email address hidden>
Date: Mon Apr 7 14:52:54 2014 +1000

    Don't call provision.py directly

    When testr.conf calls the sqlalchemy/provision.py script directly,
    sys.path[0] is the directory that invoked the script. So when it
    tries to import openstack.common.db you end up with an import failure.

    ---
    Traceback (most recent call last):
      File "./openstack/common/db/sqlalchemy/provision.py", line 27, in <module>
        from openstack.common.db import exception as exc
    ImportError: No module named openstack.common.db
    ---

    The solution is to run it with -m

    Closes-Bug: #1303579
    Change-Id: Ia7ff187df1685f0dd5ef32c3f6de474218874b04

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

Other bug subscribers

Remote bug watches

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