From f91569de61e6b91a2d6288c5f06f12d65946d80d Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Fri, 28 Mar 2014 12:29:26 -0700 Subject: [PATCH] version migration fails if version is an integer The migration 043 fails to account for the case where the version was specified as a string or version contains non-ascii characters. This breaks migration for folks that have those incorrect templatesx in their database. Change-Id: I9c2143c9d7a4d61ff41d32ee0f7b12a5640eec72 Closes-bug: 1299174 --- .../migrate_repo/versions/043_migrate_template_versions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/heat/db/sqlalchemy/migrate_repo/versions/043_migrate_template_versions.py b/heat/db/sqlalchemy/migrate_repo/versions/043_migrate_template_versions.py index 82eef6a5b..eef71b3a3 100644 --- a/heat/db/sqlalchemy/migrate_repo/versions/043_migrate_template_versions.py +++ b/heat/db/sqlalchemy/migrate_repo/versions/043_migrate_template_versions.py @@ -44,7 +44,7 @@ def upgrade(migrate_engine): try: dt = time.strptime(version, '%Y-%m-%d') - except ValueError: + except (TypeError, ValueError): dt = None if dt is None or dt < patch_date: