From 6334cac7c83dc53d20a91315eb3e75142c519fce Mon Sep 17 00:00:00 2001 From: Vlad Gridin Date: Thu, 20 Aug 2015 16:15:03 +0200 Subject: [PATCH] Remove the ML2 Nuage driver code This changeset removes ML2 Nuage driver vendor code, currently present in neutron core to vendor repo. Closes-bug: #1486662 Related-Blueprint: core-vendor-decomposition Change-Id: I6388e91ba56aa6b8f16c723f7d07234d262b6c16 --- .../ml2/drivers/mech_nuage/__init__.py | 0 .../plugins/ml2/drivers/mech_nuage/driver.py | 104 ------------------ setup.cfg | 2 - 3 files changed, 106 deletions(-) delete mode 100644 neutron/plugins/ml2/drivers/mech_nuage/__init__.py delete mode 100644 neutron/plugins/ml2/drivers/mech_nuage/driver.py diff --git a/neutron/plugins/ml2/drivers/mech_nuage/__init__.py b/neutron/plugins/ml2/drivers/mech_nuage/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/neutron/plugins/ml2/drivers/mech_nuage/driver.py b/neutron/plugins/ml2/drivers/mech_nuage/driver.py deleted file mode 100644 index 971c195b4d3..00000000000 --- a/neutron/plugins/ml2/drivers/mech_nuage/driver.py +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2014 Alcatel-Lucent USA Inc. -# -# 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 netaddr -from oslo_config import cfg -from oslo_log import log - -from neutron.common import constants as n_consts -from neutron.extensions import portbindings -from neutron.i18n import _LE -from neutron.plugins.common import constants -from neutron.plugins.ml2 import driver_api as api -from nuage_neutron.plugins.nuage.common import config -from nuage_neutron.plugins.nuage.common import constants as nuage_const -from nuage_neutron.plugins.nuage import plugin - -LOG = log.getLogger(__name__) - - -class NuageMechanismDriver(plugin.NuagePlugin, - api.MechanismDriver): - - def initialize(self): - LOG.debug('Initializing driver') - config.nuage_register_cfg_opts() - self.nuageclient_init() - self.vif_type = portbindings.VIF_TYPE_OVS - self.vif_details = {portbindings.CAP_PORT_FILTER: False} - self.default_np_id = self.nuageclient.get_net_partition_id_by_name( - cfg.CONF.RESTPROXY.default_net_partition_name) - LOG.debug('Initializing complete') - - def create_subnet_postcommit(self, context): - subnet = context.current - net = netaddr.IPNetwork(subnet['cidr']) - params = { - 'netpart_id': self.default_np_id, - 'tenant_id': subnet['tenant_id'], - 'net': net - } - self.nuageclient.create_subnet(subnet, params) - - def delete_subnet_postcommit(self, context): - subnet = context.current - self.nuageclient.delete_subnet(subnet['id']) - - def update_port_postcommit(self, context): - port = context.current - port_prefix = nuage_const.NOVA_PORT_OWNER_PREF - # Check two things prior to proceeding with - # talking to backend. - # 1) binding has happened successfully. - # 2) Its a VM port. - if ((not context.original_top_bound_segment and - context.top_bound_segment) and - port['device_owner'].startswith(port_prefix)): - np_name = cfg.CONF.RESTPROXY.default_net_partition_name - self._create_update_port(context._plugin_context, - port, np_name) - - def delete_port_postcommit(self, context): - port = context.current - np_name = cfg.CONF.RESTPROXY.default_net_partition_name - self._delete_nuage_vport(context._plugin_context, - port, np_name) - - def bind_port(self, context): - LOG.debug("Attempting to bind port %(port)s on " - "network %(network)s", - {'port': context.current['id'], - 'network': context.network.current['id']}) - for segment in context.segments_to_bind: - if self._check_segment(segment): - context.set_binding(segment[api.ID], - self.vif_type, - self.vif_details, - status=n_consts.PORT_STATUS_ACTIVE) - LOG.debug("Bound using segment: %s", segment) - return - else: - LOG.error(_LE("Refusing to bind port for segment ID %(id)s, " - "segment %(seg)s, phys net %(physnet)s, and " - "network type %(nettype)s"), - {'id': segment[api.ID], - 'seg': segment[api.SEGMENTATION_ID], - 'physnet': segment[api.PHYSICAL_NETWORK], - 'nettype': segment[api.NETWORK_TYPE]}) - - def _check_segment(self, segment): - """Verify a segment is valid for the Nuage MechanismDriver.""" - network_type = segment[api.NETWORK_TYPE] - return network_type in [constants.TYPE_LOCAL, constants.TYPE_GRE, - constants.TYPE_VXLAN, constants.TYPE_VLAN] diff --git a/setup.cfg b/setup.cfg index 9e332f9f223..63ce1645c97 100644 --- a/setup.cfg +++ b/setup.cfg @@ -68,7 +68,6 @@ data_files = etc/neutron/plugins/ml2/ml2_conf_ofa.ini etc/neutron/plugins/ml2/ml2_conf_fslsdn.ini etc/neutron/plugins/ml2/ml2_conf_sriov.ini - etc/neutron/plugins/nuage/nuage_plugin.ini etc/neutron/plugins/ml2/openvswitch_agent.ini etc/neutron/plugins/mlnx = etc/neutron/plugins/mlnx/mlnx_conf.ini etc/neutron/plugins/nec = etc/neutron/plugins/nec/nec.ini @@ -172,7 +171,6 @@ neutron.ml2.mechanism_drivers = brocade_fi_ni = neutron.plugins.ml2.drivers.brocade.fi_ni.mechanism_brocade_fi_ni:BrocadeFiNiMechanism fslsdn = neutron.plugins.ml2.drivers.freescale.mechanism_fslsdn:FslsdnMechanismDriver sriovnicswitch = neutron.plugins.ml2.drivers.mech_sriov.mech_driver.mech_driver:SriovNicSwitchMechanismDriver - nuage = neutron.plugins.ml2.drivers.mech_nuage.driver:NuageMechanismDriver fake_agent = neutron.tests.unit.plugins.ml2.drivers.mech_fake_agent:FakeAgentMechanismDriver sdnve = neutron.plugins.ml2.drivers.ibm.mechanism_sdnve:SdnveMechanismDriver neutron.ml2.extension_drivers =