From b8341239df2190bc33d20837e4a08cc6bc471c0b Mon Sep 17 00:00:00 2001 From: Xu Han Peng Date: Fri, 6 Mar 2015 18:30:30 +0800 Subject: [PATCH] Fix DB2 upgrade problem for Remove Hyper-V plugin The recently added upgrade script to remove hyperv neutron plugin breaks upgrade on DB2. This fix solves this problme by using "1" instead of "true" in sql when db2 is engine. Change-Id: I1afdf66c25dbea46588ee7b205fa6394b08c1de8 Closes-Bug: 1429058 --- ...801560a332_remove_hypervneutronplugin_tables.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/neutron/db/migration/alembic_migrations/versions/2b801560a332_remove_hypervneutronplugin_tables.py b/neutron/db/migration/alembic_migrations/versions/2b801560a332_remove_hypervneutronplugin_tables.py index ec92ce957..aa6c46ef7 100644 --- a/neutron/db/migration/alembic_migrations/versions/2b801560a332_remove_hypervneutronplugin_tables.py +++ b/neutron/db/migration/alembic_migrations/versions/2b801560a332_remove_hypervneutronplugin_tables.py @@ -66,10 +66,16 @@ def _migrate_segment_dict(binding): def _migrate_vlan_allocations(): # Code similar to migrate_to_ml2.BaseMigrateToMl2.migrate_vlan_allocations - op.execute('INSERT INTO ml2_vlan_allocations ' - 'SELECT physical_network, vlan_id, allocated ' - 'FROM hyperv_vlan_allocations ' - 'WHERE allocated = TRUE') + if op.get_bind().engine.name == 'ibm_db_sa': + op.execute('INSERT INTO ml2_vlan_allocations ' + 'SELECT physical_network, vlan_id, allocated ' + 'FROM hyperv_vlan_allocations ' + 'WHERE allocated = 1') + else: + op.execute('INSERT INTO ml2_vlan_allocations ' + 'SELECT physical_network, vlan_id, allocated ' + 'FROM hyperv_vlan_allocations ' + 'WHERE allocated = TRUE') def _migrate_network_segments(engine): -- 2.45.2