diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-02-23 12:00:02 -0800 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2011-02-23 12:00:02 -0800 |
| commit | 19dc13131b7fe512cb7897a888093b5c9a62e69d (patch) | |
| tree | 8a4b4713f7a7fc53bd44b1464ecd8ebe0a25db51 /nova | |
| parent | 0addb1147f4d9edf6a320953814f3e2c0d13ef35 (diff) | |
| download | nova-19dc13131b7fe512cb7897a888093b5c9a62e69d.tar.gz nova-19dc13131b7fe512cb7897a888093b5c9a62e69d.tar.xz nova-19dc13131b7fe512cb7897a888093b5c9a62e69d.zip | |
move the deletion of the db into fixtures
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/tests/__init__.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/nova/tests/__init__.py b/nova/tests/__init__.py index dbd433054..7fba02a93 100644 --- a/nova/tests/__init__.py +++ b/nova/tests/__init__.py @@ -48,6 +48,9 @@ def setup(): FLAGS = flags.FLAGS + testdb = os.path.join(FLAGS.state_path, FLAGS.sqlite_db) + if os.path.exists(testdb): + os.unlink(testdb) migration.db_sync() ctxt = context.get_admin_context() network_manager.VlanManager().create_networks(ctxt, @@ -58,5 +61,6 @@ def setup(): FLAGS.vlan_start, FLAGS.vpn_start, ) - shutil.copyfile(os.path.join(FLAGS.state_path, FLAGS.sqlite_db), - os.path.join(FLAGS.state_path, FLAGS.sqlite_clean_db)) + + cleandb = os.path.join(FLAGS.state_path, FLAGS.sqlite_clean_db) + shutil.copyfile(testdb, cleandb) |
