diff options
author | Zuul <zuul@review.openstack.org> | 2018-03-01 10:52:04 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2018-03-01 10:52:04 +0000 |
commit | 324d504d101dadb6dba86f857f86dcffa558475f (patch) | |
tree | 2b52dbe4de0d14753e554c5c7421a0d374792f9f /oslo_db | |
parent | 9c6695969f6502f52bc86f22af0758715fdc57c0 (diff) | |
parent | 3b260a3bca8c9af6fc81a122e8696e09802a6881 (diff) | |
download | oslo-db-324d504d101dadb6dba86f857f86dcffa558475f.tar.gz |
Merge "Conditionally adjust for quoting in comparing MySQL defaults"
Diffstat (limited to 'oslo_db')
-rw-r--r-- | oslo_db/sqlalchemy/test_migrations.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/oslo_db/sqlalchemy/test_migrations.py b/oslo_db/sqlalchemy/test_migrations.py index d650025..4b8cb12 100644 --- a/oslo_db/sqlalchemy/test_migrations.py +++ b/oslo_db/sqlalchemy/test_migrations.py @@ -476,9 +476,10 @@ class ModelsMigrationsSync(object): if isinstance(meta_col.type, sqlalchemy.Boolean): if meta_def is None or insp_def is None: return meta_def != insp_def + insp_def = insp_def.strip("'") return not ( - isinstance(meta_def.arg, expr.True_) and insp_def == "'1'" or - isinstance(meta_def.arg, expr.False_) and insp_def == "'0'" + isinstance(meta_def.arg, expr.True_) and insp_def == "1" or + isinstance(meta_def.arg, expr.False_) and insp_def == "0" ) impl_type = meta_col.type @@ -487,7 +488,8 @@ class ModelsMigrationsSync(object): if isinstance(impl_type, (sqlalchemy.Integer, sqlalchemy.BigInteger)): if meta_def is None or insp_def is None: return meta_def != insp_def - return meta_def.arg != insp_def.split("'")[1] + insp_def = insp_def.strip("'") + return meta_def.arg != insp_def @_compare_server_default.dispatch_for('postgresql') def _compare_server_default(bind, meta_col, insp_def, meta_def): |