From 43ae413da583509448d82ce4ab48f8c8a66a9eb5 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Fri, 7 Sep 2012 15:56:54 -0700 Subject: [PATCH] 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 --- .../migrate_repo/versions/098_update_volume_attach_time.py | 4 ++-- 1 file 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 1d16f093b92..680b27df740 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()