From 14e67087828d46a504180b7ac130732286502fb5 Mon Sep 17 00:00:00 2001 From: Carol Bouchard Date: Fri, 14 Aug 2015 13:39:45 -0400 Subject: [PATCH] Final decomposition of ML2 Nexus Driver This changeset removes the remaining ML2 Nexus Driver Vendor code from the neutron repo. It has been moved to the networking-cisco repo. Change-Id: I95540f35f80ad8eba4bc3f6fa37095842e42c037 Closes-bug: #1482366 Implements: blueprint: core-vendor-decomposition --- .../migration/alembic_migrations/external.py | 4 + neutron/db/migration/models/head.py | 2 - .../ml2/drivers/cisco/nexus/__init__.py | 0 .../drivers/cisco/nexus/mech_cisco_nexus.py | 24 ----- .../drivers/cisco/nexus/nexus_models_v2.py | 90 ------------------- .../ml2/drivers/cisco/nexus/requirements.txt | 1 - .../drivers/cisco/nexus/type_nexus_vxlan.py | 21 ----- setup.cfg | 2 - 8 files changed, 4 insertions(+), 140 deletions(-) delete mode 100644 neutron/plugins/ml2/drivers/cisco/nexus/__init__.py delete mode 100644 neutron/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py delete mode 100644 neutron/plugins/ml2/drivers/cisco/nexus/nexus_models_v2.py delete mode 100644 neutron/plugins/ml2/drivers/cisco/nexus/requirements.txt delete mode 100644 neutron/plugins/ml2/drivers/cisco/nexus/type_nexus_vxlan.py diff --git a/neutron/db/migration/alembic_migrations/external.py b/neutron/db/migration/alembic_migrations/external.py index 7bd9ae81a..267db137c 100644 --- a/neutron/db/migration/alembic_migrations/external.py +++ b/neutron/db/migration/alembic_migrations/external.py @@ -40,6 +40,10 @@ DRIVER_TABLES = [ 'cisco_ml2_n1kv_vxlan_allocations', 'cisco_ml2_n1kv_vlan_allocations', 'cisco_ml2_n1kv_profile_bindings', + 'cisco_ml2_nexusport_bindings', + 'cisco_ml2_nexus_nve', + 'ml2_nexus_vxlan_allocations', + 'ml2_nexus_vxlan_mcast_groups', # VMware-NSX models moved to openstack/vmware-nsx 'tz_network_bindings', 'neutron_nsx_network_mappings', diff --git a/neutron/db/migration/models/head.py b/neutron/db/migration/models/head.py index 75d7242bb..5eb02213c 100644 --- a/neutron/db/migration/models/head.py +++ b/neutron/db/migration/models/head.py @@ -55,8 +55,6 @@ from neutron.plugins.cisco.db import n1kv_models_v2 # noqa from neutron.plugins.cisco.db import network_models_v2 # noqa from neutron.plugins.ml2.drivers.brocade.db import ( # noqa models as ml2_brocade_models) -from neutron.plugins.ml2.drivers.cisco.nexus import ( # noqa - nexus_models_v2 as ml2_nexus_models_v2) from neutron.plugins.ml2.drivers.cisco.ucsm import ucsm_model # noqa from neutron.plugins.ml2.drivers import type_flat # noqa from neutron.plugins.ml2.drivers import type_gre # noqa diff --git a/neutron/plugins/ml2/drivers/cisco/nexus/__init__.py b/neutron/plugins/ml2/drivers/cisco/nexus/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/neutron/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py b/neutron/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py deleted file mode 100644 index fac9503df..000000000 --- a/neutron/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2013 OpenStack Foundation -# All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -""" -ML2 Mechanism Driver for Cisco Nexus platforms. -""" - -from networking_cisco.plugins.ml2.drivers.cisco.nexus import mech_cisco_nexus - - -class CiscoNexusMechanismDriver(mech_cisco_nexus.CiscoNexusMechanismDriver): - pass diff --git a/neutron/plugins/ml2/drivers/cisco/nexus/nexus_models_v2.py b/neutron/plugins/ml2/drivers/cisco/nexus/nexus_models_v2.py deleted file mode 100644 index 045499ce3..000000000 --- a/neutron/plugins/ml2/drivers/cisco/nexus/nexus_models_v2.py +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (c) 2013 OpenStack Foundation -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - - -import sqlalchemy as sa - -from neutron.db import model_base -from neutron.db import models_v2 - - -class NexusPortBinding(model_base.BASEV2): - """Represents a binding of VM's to nexus ports.""" - - __tablename__ = "cisco_ml2_nexusport_bindings" - - binding_id = sa.Column(sa.Integer, primary_key=True, autoincrement=True) - port_id = sa.Column(sa.String(255)) - vlan_id = sa.Column(sa.Integer, nullable=False) - vni = sa.Column(sa.Integer) - switch_ip = sa.Column(sa.String(255)) - instance_id = sa.Column(sa.String(255)) - is_provider_vlan = sa.Column(sa.Boolean(), nullable=False, default=False, - server_default=sa.sql.false()) - - def __repr__(self): - """Just the binding, without the id key.""" - return ("" % - (self.port_id, self.vlan_id, self.vni, self.switch_ip, - self.instance_id, - 'True' if self.is_provider_vlan else 'False')) - - def __eq__(self, other): - """Compare only the binding, without the id key.""" - return ( - self.port_id == other.port_id and - self.vlan_id == other.vlan_id and - self.vni == other.vni and - self.switch_ip == other.switch_ip and - self.instance_id == other.instance_id and - self.is_provider_vlan == other.is_provider_vlan - ) - - -class NexusNVEBinding(model_base.BASEV2): - """Represents Network Virtualization Endpoint configuration.""" - - __tablename__ = "cisco_ml2_nexus_nve" - - vni = sa.Column(sa.Integer, primary_key=True, nullable=False) - device_id = sa.Column(sa.String(255), primary_key=True) - switch_ip = sa.Column(sa.String(255), primary_key=True) - mcast_group = sa.Column(sa.String(255)) - - def __repr__(self): - return ("" % - (self.vni, self.switch_ip, self.device_id, self.mcast_group)) - - -class NexusVxlanAllocation(model_base.BASEV2): - - __tablename__ = 'ml2_nexus_vxlan_allocations' - - vxlan_vni = sa.Column(sa.Integer, nullable=False, primary_key=True, - autoincrement=False) - allocated = sa.Column(sa.Boolean, nullable=False, default=False, - server_default=sa.sql.false()) - - -class NexusMcastGroup(model_base.BASEV2, models_v2.HasId): - - __tablename__ = 'ml2_nexus_vxlan_mcast_groups' - - mcast_group = sa.Column(sa.String(64), nullable=False) - associated_vni = sa.Column(sa.Integer, - sa.ForeignKey( - 'ml2_nexus_vxlan_allocations.vxlan_vni', - ondelete="CASCADE"), - nullable=False) diff --git a/neutron/plugins/ml2/drivers/cisco/nexus/requirements.txt b/neutron/plugins/ml2/drivers/cisco/nexus/requirements.txt deleted file mode 100644 index ef631a3f2..000000000 --- a/neutron/plugins/ml2/drivers/cisco/nexus/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -networking-cisco diff --git a/neutron/plugins/ml2/drivers/cisco/nexus/type_nexus_vxlan.py b/neutron/plugins/ml2/drivers/cisco/nexus/type_nexus_vxlan.py deleted file mode 100644 index 933b1e317..000000000 --- a/neutron/plugins/ml2/drivers/cisco/nexus/type_nexus_vxlan.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2015 Cisco Systems Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# - -from networking_cisco.plugins.ml2.drivers.cisco.nexus import type_nexus_vxlan - - -class NexusVxlanTypeDriver(type_nexus_vxlan.NexusVxlanTypeDriver): - pass diff --git a/setup.cfg b/setup.cfg index 8235ce3b4..7a0a1d29b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -158,7 +158,6 @@ neutron.ml2.type_drivers = vlan = neutron.plugins.ml2.drivers.type_vlan:VlanTypeDriver gre = neutron.plugins.ml2.drivers.type_gre:GreTypeDriver vxlan = neutron.plugins.ml2.drivers.type_vxlan:VxlanTypeDriver - nexus_vxlan = neutron.plugins.ml2.drivers.cisco.nexus.type_nexus_vxlan:NexusVxlanTypeDriver neutron.ml2.mechanism_drivers = ovsvapp = neutron.plugins.ml2.drivers.ovsvapp.mech_driver:OVSvAppAgentMechanismDriver opendaylight = neutron.plugins.ml2.drivers.opendaylight.driver:OpenDaylightMechanismDriver @@ -167,7 +166,6 @@ neutron.ml2.mechanism_drivers = linuxbridge = neutron.plugins.ml2.drivers.linuxbridge.mech_driver.mech_linuxbridge:LinuxbridgeMechanismDriver openvswitch = neutron.plugins.ml2.drivers.openvswitch.mech_driver.mech_openvswitch:OpenvswitchMechanismDriver hyperv = neutron.plugins.ml2.drivers.hyperv.mech_hyperv:HypervMechanismDriver - cisco_nexus = neutron.plugins.ml2.drivers.cisco.nexus.mech_cisco_nexus:CiscoNexusMechanismDriver cisco_ucsm = neutron.plugins.ml2.drivers.cisco.ucsm.mech_cisco_ucsm:CiscoUcsmMechanismDriver l2population = neutron.plugins.ml2.drivers.l2pop.mech_driver:L2populationMechanismDriver ofagent = neutron.plugins.ml2.drivers.ofagent.driver:OfagentMechanismDriver -- 2.45.2