summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Harris <rconradharris@gmail.com>2013-02-21 23:15:08 +0000
committerRick Harris <rconradharris@gmail.com>2013-02-21 23:15:08 +0000
commit0356446d752bc5c5d408766951ccf22bec4af9fb (patch)
tree4fbabf04f53ab85437feaa9affe221744aade611
parente7dcbf570b2b4e8385b085c5c9ce4e6ad5a0c0ab (diff)
downloadnova-0356446d752bc5c5d408766951ccf22bec4af9fb.tar.gz
nova-0356446d752bc5c5d408766951ccf22bec4af9fb.tar.xz
nova-0356446d752bc5c5d408766951ccf22bec4af9fb.zip
Fix migration snake-walk.
The original code was not actually running `downgrade` because it attempt to `downgrade` to the current version. The fix is to downgrade to the current_version - 1. Change-Id: I69484039269a17e343404bff195a6f84af56972c
-rw-r--r--nova/tests/test_migrations.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py
index 2e5a01a6a..3cb2df41f 100644
--- a/nova/tests/test_migrations.py
+++ b/nova/tests/test_migrations.py
@@ -374,7 +374,7 @@ class BaseMigrationTestCase(test.TestCase):
# upgrade -> downgrade -> upgrade
self._migrate_up(engine, version, with_data=True)
if snake_walk:
- self._migrate_down(engine, version)
+ self._migrate_down(engine, version - 1)
self._migrate_up(engine, version)
if downgrade:
@@ -384,10 +384,10 @@ class BaseMigrationTestCase(test.TestCase):
xrange(self.INIT_VERSION + 2,
self.REPOSITORY.latest + 1)):
# downgrade -> upgrade -> downgrade
- self._migrate_down(engine, version)
+ self._migrate_down(engine, version - 1)
if snake_walk:
self._migrate_up(engine, version)
- self._migrate_down(engine, version)
+ self._migrate_down(engine, version - 1)
def _migrate_down(self, engine, version):
self.migration_api.downgrade(engine,