Merge "migration_get_all_unconfirmed() now uses lowercase "finished" Fixes bug 977719"

This commit is contained in:
Jenkins 2012-04-10 16:31:35 +00:00 committed by Gerrit Code Review
commit e80c6fe323
3 changed files with 4 additions and 3 deletions

View File

@ -124,6 +124,7 @@ Loganathan Parthipan <parthipan@hp.com>
Lorin Hochstein <lorin@nimbisservices.com>
Lvov Maxim <usrleon@gmail.com>
Mandell Degerness <mdegerne@gmail.com>
Mandar Vaze <mandar.vaze@vertex.co.in>
Mark McClain <mark.mcclain@dreamhost.com>
Mark McLoughlin <markmc@redhat.com>
Mark Washenberger <mark.washenberger@rackspace.com>

View File

@ -3264,7 +3264,7 @@ def migration_get_all_unconfirmed(context, confirm_window, session=None):
return model_query(context, models.Migration, session=session,
read_deleted="yes").\
filter(models.Migration.updated_at <= confirm_window).\
filter_by(status="FINISHED").\
filter_by(status="finished").\
all()

View File

@ -89,7 +89,7 @@ class DbApiTestCase(test.TestCase):
# Ensure one migration older than 10 seconds is returned.
updated_at = datetime.datetime(2000, 01, 01, 12, 00, 00)
values = {"status": "FINISHED", "updated_at": updated_at}
values = {"status": "finished", "updated_at": updated_at}
migration = db.migration_create(ctxt, values)
results = db.migration_get_all_unconfirmed(ctxt, 10)
self.assertEqual(1, len(results))
@ -97,7 +97,7 @@ class DbApiTestCase(test.TestCase):
# Ensure the new migration is not returned.
updated_at = datetime.datetime.utcnow()
values = {"status": "FINISHED", "updated_at": updated_at}
values = {"status": "finished", "updated_at": updated_at}
migration = db.migration_create(ctxt, values)
results = db.migration_get_all_unconfirmed(ctxt, 10)
self.assertEqual(0, len(results))