Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Don't call provision.py directly
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ianw committed Apr 7, 2014
1 parent f32f2d9 commit 2ae2377
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .testr.conf
Expand Up @@ -14,6 +14,6 @@ test_list_option=--list
# https://testrepository.readthedocs.org/en/latest/MANUAL.html#remote-or-isolated-test-environments
# for details.

instance_provision=${PYTHON:-python} ./openstack/common/db/sqlalchemy/provision.py create $INSTANCE_COUNT
instance_dispose=${PYTHON:-python} ./openstack/common/db/sqlalchemy/provision.py drop $INSTANCE_IDS
instance_provision=${PYTHON:-python} -m openstack.common.db.sqlalchemy.provision create $INSTANCE_COUNT
instance_dispose=${PYTHON:-python} -m openstack.common.db.sqlalchemy.provision drop $INSTANCE_IDS
instance_execute=OS_TEST_DBAPI_CONNECTION=$INSTANCE_ID $COMMAND

0 comments on commit 2ae2377

Please sign in to comment.