From 681ac331765892cfc8885907f87d2b3168a66012 Mon Sep 17 00:00:00 2001 From: Kobi Samoray Date: Sun, 11 Jan 2015 11:28:42 +0200 Subject: [PATCH] VMWare NSXv DB model bugfix DB Model and migration for VMWare NSXv had two issues: In DB migration, nsxv_security_group_section_mappings table is not dropped on downgrade. In nsxv_models.py, tz_network_bindings_binding_type enum name should be nsxv_tz_network_bindings_binding_type to match migration code. Change-Id: Ib5e8a2078d9c86da6375c7b6a39f48d5bba4e06e Closes-bug: #1409411 --- .../alembic_migrations/versions/4dbe243cd84d_nsxv.py | 4 ++-- neutron/plugins/vmware/dbexts/nsxv_models.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/neutron/db/migration/alembic_migrations/versions/4dbe243cd84d_nsxv.py b/neutron/db/migration/alembic_migrations/versions/4dbe243cd84d_nsxv.py index 5867f6c9c..3fbb7ea5f 100644 --- a/neutron/db/migration/alembic_migrations/versions/4dbe243cd84d_nsxv.py +++ b/neutron/db/migration/alembic_migrations/versions/4dbe243cd84d_nsxv.py @@ -151,7 +151,7 @@ def downgrade(): op.drop_table('nsxv_port_index_mappings') op.drop_table('nsxv_port_vnic_mappings') op.drop_table('nsxv_tz_network_bindings') - op.drop_table('nsxv_section_mappings') + op.drop_table('nsxv_security_group_section_mappings') op.drop_table('nsxv_spoofguard_policy_network_mappings') op.drop_table('nsxv_edge_vnic_bindings') op.drop_table('nsxv_edge_dhcp_static_bindings') @@ -163,4 +163,4 @@ def downgrade(): edge_types_enum.drop(op.get_bind(), checkfirst=False) internal_network_purpose_enum.drop(op.get_bind(), checkfirst=False) internal_edge_purpose_enum.drop(op.get_bind(), checkfirst=False) - tz_binding_type_enum.drop(op.get_bind(), checkfirst=False) \ No newline at end of file + tz_binding_type_enum.drop(op.get_bind(), checkfirst=False) diff --git a/neutron/plugins/vmware/dbexts/nsxv_models.py b/neutron/plugins/vmware/dbexts/nsxv_models.py index 4e9cecd95..395238db0 100644 --- a/neutron/plugins/vmware/dbexts/nsxv_models.py +++ b/neutron/plugins/vmware/dbexts/nsxv_models.py @@ -172,9 +172,10 @@ class NsxvTzNetworkBinding(model_base.BASEV2): network_id = sa.Column(sa.String(36), sa.ForeignKey('networks.id', ondelete="CASCADE"), primary_key=True) - binding_type = sa.Column(sa.Enum('flat', 'vlan', 'portgroup', - name='tz_network_bindings_binding_type'), - nullable=False, primary_key=True) + binding_type = sa.Column( + sa.Enum('flat', 'vlan', 'portgroup', + name='nsxv_tz_network_bindings_binding_type'), + nullable=False, primary_key=True) phy_uuid = sa.Column(sa.String(36), primary_key=True, nullable=True) vlan_id = sa.Column(sa.Integer, primary_key=True, nullable=True, autoincrement=False) -- 2.45.2