From 438c4feea059afdb99270577f587368a23661491 Mon Sep 17 00:00:00 2001 From: Thomas Bachman Date: Fri, 16 Nov 2018 00:30:25 +0000 Subject: [PATCH] Only add SVI when extensions are present Commit d75ce445e7b6d6f7c8d4115e79e7815040570399 added the SVI extension to networks. These should not be applied when the legacy plugin is used. Check for the presence of extensions only used in the merged plugin before applying the SVI extension to the resource. Change-Id: Ib0bf8028e39b897f460c7eb374ed8d2d64fdc516 --- .../1c564e737f9f_network_extension_migration_for_svi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gbpservice/neutron/db/migration/alembic_migrations/versions/1c564e737f9f_network_extension_migration_for_svi.py b/gbpservice/neutron/db/migration/alembic_migrations/versions/1c564e737f9f_network_extension_migration_for_svi.py index 098db4487..19508387c 100644 --- a/gbpservice/neutron/db/migration/alembic_migrations/versions/1c564e737f9f_network_extension_migration_for_svi.py +++ b/gbpservice/neutron/db/migration/alembic_migrations/versions/1c564e737f9f_network_extension_migration_for_svi.py @@ -51,6 +51,10 @@ def upgrade(): net_dbs = (session.query(models_v2.Network) .options(lazyload('*')).all()) for net_db in net_dbs: + # Skip applying this update if using a legacy plugin + if not hasattr(net_db, 'aim_extension_mapping') or ( + net_db.aim_extension_mapping is None): + continue util.msg("Migrating network: %s" % net_db) # If this update is successful then it means its an external # network with its DN set.