From: Mark McClain Date: Wed, 8 Oct 2014 19:38:19 +0000 (-0400) Subject: update ml2_migration to reflect optional methods X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=dd35d64812fd0ad02e7a00432073d141049e7107;p=openstack-build%2Fneutron-build.git update ml2_migration to reflect optional methods This change conditionally executes the schema methods for versions that support them. Change-Id: I8a51ac04e62dfcfe1e0a2e69a17664d154f0d1d7 Closes-Bug: #1378732 --- diff --git a/neutron/db/migration/migrate_to_ml2.py b/neutron/db/migration/migrate_to_ml2.py index 97a187015..fc5fa4216 100755 --- a/neutron/db/migration/migrate_to_ml2.py +++ b/neutron/db/migration/migrate_to_ml2.py @@ -132,7 +132,8 @@ class BaseMigrateToMl2(object): metadata = sa.MetaData() check_db_schema_version(engine, metadata) - self.define_ml2_tables(metadata) + if hasattr(self, 'define_ml2_tables'): + self.define_ml2_tables(metadata) # Autoload the ports table to ensure that foreign keys to it and # the network table can be created for the new tables. @@ -145,7 +146,8 @@ class BaseMigrateToMl2(object): self.migrate_vlan_allocations(engine) self.migrate_port_bindings(engine, metadata) - self.drop_old_tables(engine, save_tables) + if hasattr(self, 'drop_old_tables'): + self.drop_old_tables(engine, save_tables) def migrate_segment_dict(self, binding): binding['id'] = uuidutils.generate_uuid()