]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Rename args for alembic 0.8.0
authorHenry Gessau <gessau@cisco.com>
Thu, 13 Aug 2015 23:58:58 +0000 (19:58 -0400)
committerHenry Gessau <gessau@cisco.com>
Wed, 19 Aug 2015 01:54:08 +0000 (21:54 -0400)
Version 0.8.0 of alembic has renamed some arguments in some of its
methods. This generates warnings when running neutron's alembic
migration scripts.

Change-Id: I4f90a66c2465dd1d7f6631f297146754fd5e9cc4

neutron/db/migration/__init__.py
neutron/db/migration/alembic_migrations/versions/16cdf118d31d_extra_dhcp_options_ipv6_support.py
neutron/db/migration/alembic_migrations/versions/2a1ee2fb59e0_add_mac_address_unique_constraint.py
neutron/db/migration/alembic_migrations/versions/38495dc99731_ml2_tunnel_endpoints_table.py
neutron/db/migration/alembic_migrations/versions/41662e32bce2_l3_dvr_snat_mapping.py
neutron/db/migration/alembic_migrations/versions/44621190bc02_add_uniqueconstraint_ipavailability_ranges.py
neutron/db/migration/alembic_migrations/versions/57dd745253a6_nuage_kilo_migrate.py
neutron/db/migration/alembic_migrations/versions/f15b1fb526dd_cascade_floatingip.py

index 86cce385af93bbdd87236b4de6f95cb97332eec6..d92e57c49cbe63ce48f112f847809de0a1a5e7f9 100644 (file)
@@ -129,7 +129,7 @@ def create_table_if_not_exist_psql(table_name, values):
 def remove_foreign_keys(table, foreign_keys):
     for fk in foreign_keys:
         op.drop_constraint(
-            name=fk['name'],
+            constraint_name=fk['name'],
             table_name=table,
             type_='foreignkey'
         )
@@ -138,9 +138,9 @@ def remove_foreign_keys(table, foreign_keys):
 def create_foreign_keys(table, foreign_keys):
     for fk in foreign_keys:
         op.create_foreign_key(
-            name=fk['name'],
-            source=table,
-            referent=fk['referred_table'],
+            constraint_name=fk['name'],
+            source_table=table,
+            referent_table=fk['referred_table'],
             local_cols=fk['constrained_columns'],
             remote_cols=fk['referred_columns'],
             ondelete='CASCADE'
index a60a9e17a474486dc5f6a7bd63312b96bcf946c1..00505e7ad05d14b02e93924c948c306c29fe4dee 100644 (file)
@@ -38,7 +38,7 @@ TABLE_NAME = 'extradhcpopts'
 def upgrade():
     with migration.remove_fks_from_table(TABLE_NAME):
         op.drop_constraint(
-            name=CONSTRAINT_NAME_OLD,
+            constraint_name=CONSTRAINT_NAME_OLD,
             table_name=TABLE_NAME,
             type_='unique'
         )
@@ -48,7 +48,7 @@ def upgrade():
         op.execute("UPDATE extradhcpopts SET ip_version = 4")
 
     op.create_unique_constraint(
-        name=CONSTRAINT_NAME_NEW,
-        source='extradhcpopts',
-        local_cols=['port_id', 'opt_name', 'ip_version']
+        constraint_name=CONSTRAINT_NAME_NEW,
+        table_name='extradhcpopts',
+        columns=['port_id', 'opt_name', 'ip_version']
     )
index fec9a6390d5a5cab73dbd6b9144b5136cccb1393..44d3d103dad2a30c9cafd43c5cd8dea74fdcd7d3 100644 (file)
@@ -33,7 +33,7 @@ CONSTRAINT_NAME = 'uniq_ports0network_id0mac_address'
 
 def upgrade():
     op.create_unique_constraint(
-        name=CONSTRAINT_NAME,
-        source=TABLE_NAME,
-        local_cols=['network_id', 'mac_address']
+        constraint_name=CONSTRAINT_NAME,
+        table_name=TABLE_NAME,
+        columns=['network_id', 'mac_address']
     )
index 65f6f302a08d83d49a5c4a0403d6892aab01278a..3bf08bd388b6555d24d52e7113e51c3cc5fff5cb 100644 (file)
@@ -37,15 +37,15 @@ def upgrade():
     op.add_column('ml2_gre_endpoints',
                   sa.Column('host', sa.String(length=255), nullable=True))
     op.create_unique_constraint(
-        name=CONSTRAINT_NAME_GRE,
-        source='ml2_gre_endpoints',
-        local_cols=['host']
+        constraint_name=CONSTRAINT_NAME_GRE,
+        table_name='ml2_gre_endpoints',
+        columns=['host']
     )
 
     op.add_column('ml2_vxlan_endpoints',
                   sa.Column('host', sa.String(length=255), nullable=True))
     op.create_unique_constraint(
-        name=CONSTRAINT_NAME_VXLAN,
-        source='ml2_vxlan_endpoints',
-        local_cols=['host']
+        constraint_name=CONSTRAINT_NAME_VXLAN,
+        table_name='ml2_vxlan_endpoints',
+        columns=['host']
     )
index 75fe067bd895a6f4c6414210d312948cc12a6dde..489fd69968e618ed2cab247241528171b8b586a8 100644 (file)
@@ -40,10 +40,10 @@ def upgrade():
     prev_pk_name = prev_pk_const.get('name')
 
     with migration.remove_fks_from_table(TABLE_NAME):
-        op.drop_constraint(name=prev_pk_name,
+        op.drop_constraint(constraint_name=prev_pk_name,
                            table_name=TABLE_NAME,
                            type_='primary')
 
-        op.create_primary_key(name=None,
+        op.create_primary_key(constraint_name=None,
                               table_name=TABLE_NAME,
-                              cols=['router_id', 'l3_agent_id'])
+                              columns=['router_id', 'l3_agent_id'])
index 1a00de50031af8b9c0cb9c64628e076e9afe1188..314116a20c57bac1936244ac6ac35a65703b4c32 100644 (file)
@@ -35,13 +35,13 @@ UC_2_NAME = 'uniq_ipavailabilityranges0last_ip0allocation_pool_id'
 
 def upgrade():
     op.create_unique_constraint(
-        name=UC_1_NAME,
-        source=TABLE_NAME,
-        local_cols=['first_ip', 'allocation_pool_id']
+        constraint_name=UC_1_NAME,
+        table_name=TABLE_NAME,
+        columns=['first_ip', 'allocation_pool_id']
     )
 
     op.create_unique_constraint(
-        name=UC_2_NAME,
-        source=TABLE_NAME,
-        local_cols=['last_ip', 'allocation_pool_id']
+        constraint_name=UC_2_NAME,
+        table_name=TABLE_NAME,
+        columns=['last_ip', 'allocation_pool_id']
     )
index e03769e2922a9212c4be734610aa464879f236a5..96b08be47fb589137ff41c26045432945ae77111 100644 (file)
@@ -44,10 +44,10 @@ def upgrade():
     op.add_column('nuage_subnet_l2dom_mapping',
         sa.Column('nuage_managed_subnet', sa.Boolean(), nullable=True))
     op.create_unique_constraint(
-        name=CONSTRAINT_NAME_NR,
-        source='nuage_net_partition_router_mapping',
-        local_cols=['nuage_router_id'])
+        constraint_name=CONSTRAINT_NAME_NR,
+        table_name='nuage_net_partition_router_mapping',
+        columns=['nuage_router_id'])
     op.create_unique_constraint(
-        name=CONSTRAINT_NAME_NS,
-        source='nuage_subnet_l2dom_mapping',
-        local_cols=['nuage_subnet_id'])
+        constraint_name=CONSTRAINT_NAME_NS,
+        table_name='nuage_subnet_l2dom_mapping',
+        columns=['nuage_subnet_id'])
index 51958697a57d5160ddd689a20c696525922041e9..298a1f5c05e05bb9720e7ddf4562a258374a9fba 100644 (file)
@@ -40,7 +40,7 @@ def _drop_constraint():
 def upgrade():
     _drop_constraint()
     op.create_foreign_key(
-        name=None,
-        source='floatingips', referent='ports',
+        constraint_name=None,
+        source_table='floatingips', referent_table='ports',
         local_cols=['floating_port_id'], remote_cols=['id'], ondelete='CASCADE'
     )