diff options
| author | Dan Prince <dprince@redhat.com> | 2012-08-03 13:07:47 -0400 |
|---|---|---|
| committer | Dan Prince <dprince@redhat.com> | 2012-08-03 13:09:52 -0400 |
| commit | 3356d55977a0ff091711dcf368d0cc13ae0567f8 (patch) | |
| tree | 35a895140dd5cd7f0d2f9eaf7d0cdfb20ef81199 | |
| parent | 87dcb13117459da0e92b98feadab8a4ecba2c4f9 (diff) | |
Update reset_db to call setup if _DB is None.
This resolves issues when running individual tests that require
a database. With this fix I can once again run individual test
modules that make use of the database. For example:
./run_tests.sh test_libvirt
Previously this would fail with database errors.
Fixes LP Bug #1032738.
Change-Id: Icce7ac9414f0e19eece44819a217634947de7f73
| -rw-r--r-- | nova/tests/__init__.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/tests/__init__.py b/nova/tests/__init__.py index a8d0ef28c..e438e1d64 100644 --- a/nova/tests/__init__.py +++ b/nova/tests/__init__.py @@ -61,6 +61,8 @@ def reset_db(): conn = engine.connect() if _DB: conn.connection.executescript(_DB) + else: + setup() else: shutil.copyfile(os.path.join(FLAGS.state_path, FLAGS.sqlite_clean_db), os.path.join(FLAGS.state_path, FLAGS.sqlite_db)) |
