Fix migration 015 downgrade with sqlite.

This adds a list() call around the select sqlalchemy to pull
the list of locations that start with swift. The list() call
forces the select query to finish, before we try to update the
database.

Change-Id: I63f2e184a49e8bbd7115dd59d644506ea4069558
This commit is contained in:
Matthew Treinish 2013-02-22 11:03:15 -05:00
parent 6a91505175
commit 8e9da71011
1 changed files with 2 additions and 2 deletions

View File

@ -50,8 +50,8 @@ def migrate_location_credentials(migrate_engine, to_quoted):
images_table = sqlalchemy.Table('images', meta, autoload=True)
images = images_table.select(images_table.c.location.startswith('swift'))\
.execute()
images = list(images_table.select(images_table.c.location.startswith(
'swift')).execute())
for image in images:
fixed_uri = fix_uri_credentials(image['location'], to_quoted)