summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Waldon <bcwaldon@gmail.com>2012-09-07 15:56:54 -0700
committerBrian Waldon <bcwaldon@gmail.com>2012-09-07 16:08:22 -0700
commit43ae413da583509448d82ce4ab48f8c8a66a9eb5 (patch)
tree9d4c6f96739f92b0960361e578925729f3ae83ee
parent2caf52e5b0d725abf124cfe289859900c334eeb8 (diff)
Execute attach_time query earlier in migration 98
MySQL was blowing up when sqlalchemy tried to execute the subqueries in up/downgrade for migration 98. SQLite wasn't blowing up on this so the tests were passing in Jenkins. There are no test changes as it depends on the functional environment in which you run the tests, not the tests themselves. Fixes bug 1047665 Change-Id: I6eb3c8dd03495cdda2574efc9b5fc2b495fbcb37
-rw-r--r--nova/db/sqlalchemy/migrate_repo/versions/098_update_volume_attach_time.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/db/sqlalchemy/migrate_repo/versions/098_update_volume_attach_time.py b/nova/db/sqlalchemy/migrate_repo/versions/098_update_volume_attach_time.py
index 1d16f093b..680b27df7 100644
--- a/nova/db/sqlalchemy/migrate_repo/versions/098_update_volume_attach_time.py
+++ b/nova/db/sqlalchemy/migrate_repo/versions/098_update_volume_attach_time.py
@@ -32,7 +32,7 @@ def upgrade(migrate_engine):
volumes_list = list(volumes.select().execute())
for v in volumes_list:
attach_time = select([volumes.c.attach_time],
- volumes.c.id == v['id'])
+ volumes.c.id == v['id']).execute().fetchone()[0]
volumes.update().\
where(volumes.c.id == v['id']).\
values(attachtime_datetime=attach_time).execute()
@@ -59,7 +59,7 @@ def downgrade(migrate_engine):
volumes_list = list(volumes.select().execute())
for v in volumes_list:
attach_time = select([volumes.c.attach_time],
- volumes.c.id == v['id'])
+ volumes.c.id == v['id']).execute().fetchone()[0]
volumes.update().\
where(volumes.c.id == v['id']).\
values(attachtime_string=attach_time).execute()