]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
use TRUE in SQL for boolean var
authorBernhard M. Wiedemann <bwiedemann@suse.de>
Thu, 11 Sep 2014 09:09:21 +0000 (11:09 +0200)
committerBernhard M. Wiedemann <bwiedemann@suse.de>
Thu, 11 Sep 2014 14:13:53 +0000 (16:13 +0200)
The "allocated" variable was defined to be a boolean type
and in postgresql this type is enforced,
while in mysql this just maps to tinyint and accepts both numbers and bools

Closes-Bug: #1368251
Change-Id: If324c8b83e490e150085d044ac61360b647522ac

neutron/db/migration/migrate_to_ml2.py

index e42c9206c9656f79ecbca58670bbe8ebfdfb99db..9c854582f14d2b6991bb5d22b2f9d0bed6f8dc81 100755 (executable)
@@ -171,7 +171,7 @@ class BaseMigrateToMl2_Icehouse(object):
           INSERT INTO ml2_vlan_allocations
             SELECT physical_network, vlan_id, allocated
               FROM %(source_table)s
-              WHERE allocated = 1
+              WHERE allocated = TRUE
         """) % {'source_table': self.vlan_allocation_table_name})
 
     def get_port_segment_map(self, engine):
@@ -390,7 +390,7 @@ class MigrateOpenvswitchToMl2_Icehouse(BaseMigrateToMl2_Icehouse):
               INSERT INTO ml2_gre_allocations
                 SELECT tunnel_id as gre_id, allocated
                   FROM ovs_tunnel_allocations
-                  WHERE allocated = 1
+                  WHERE allocated = TRUE
             """)
             engine.execute("""
               INSERT INTO ml2_gre_endpoints
@@ -404,7 +404,7 @@ class MigrateOpenvswitchToMl2_Icehouse(BaseMigrateToMl2_Icehouse):
               INSERT INTO ml2_vxlan_allocations
                 SELECT tunnel_id as vxlan_vni, allocated
                   FROM ovs_tunnel_allocations
-                  WHERE allocated = 1
+                  WHERE allocated = TRUE
             """)
             engine.execute(sa.text("""
               INSERT INTO ml2_vxlan_endpoints