Remove ovs dependency in embrane plugin
This patch changes the dependency of the embrane plugin from ovs to ml2. Existing users of the old entry point will be upgraded on a case-by-case base as needed, therefore no generic upgrade procedure is required. Change-Id: Id192fc32bd6ba7a8926eff1190070b8df5327129 Closes-Bug: #1343024
This commit is contained in:
parent
f56328738d
commit
43eab852f4
0
neutron/plugins/embrane/l2base/ml2/__init__.py
Normal file
0
neutron/plugins/embrane/l2base/ml2/__init__.py
Normal file
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2013 Embrane, Inc.
|
# Copyright 2014 Embrane, Inc.
|
||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
@ -14,6 +14,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
# @author: Ivar Lazzaro, Embrane, Inc.
|
# @author: Ivar Lazzaro, Embrane, Inc.
|
||||||
|
# @author: Ignacio Scopetta, Embrane, Inc.
|
||||||
|
|
||||||
from heleosapi import info as h_info
|
from heleosapi import info as h_info
|
||||||
|
|
||||||
@ -21,36 +22,34 @@ from neutron.common import constants
|
|||||||
from neutron import manager
|
from neutron import manager
|
||||||
from neutron.plugins.embrane.l2base import support_base as base
|
from neutron.plugins.embrane.l2base import support_base as base
|
||||||
from neutron.plugins.embrane.l2base import support_exceptions as exc
|
from neutron.plugins.embrane.l2base import support_exceptions as exc
|
||||||
from neutron.plugins.openvswitch import ovs_db_v2
|
|
||||||
|
|
||||||
|
|
||||||
class OpenvswitchSupport(base.SupportBase):
|
class Ml2Support(base.SupportBase):
|
||||||
"""OpenVSwitch plugin support.
|
"""Modular Layer 2 plugin support.
|
||||||
|
|
||||||
Obtains the informations needed to build the user security zones
|
Obtains the information needed to build the user security zones.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(OpenvswitchSupport, self).__init__()
|
super(Ml2Support, self).__init__()
|
||||||
|
|
||||||
def retrieve_utif_info(self, context, neutron_port):
|
def retrieve_utif_info(self, context, neutron_port):
|
||||||
plugin = manager.NeutronManager.get_plugin()
|
plugin = manager.NeutronManager.get_plugin()
|
||||||
session = context.session
|
network = plugin.get_network(
|
||||||
network_id = neutron_port["network_id"]
|
context, neutron_port['network_id'])
|
||||||
network_binding = ovs_db_v2.get_network_binding(session, network_id)
|
|
||||||
if not network_binding["segmentation_id"]:
|
|
||||||
raise exc.UtifInfoError(
|
|
||||||
err_msg=_("No segmentation_id found for the network, "
|
|
||||||
"please be sure that tenant_network_type is vlan"))
|
|
||||||
network = plugin._get_network(context, network_id)
|
|
||||||
is_gw = (neutron_port["device_owner"] ==
|
is_gw = (neutron_port["device_owner"] ==
|
||||||
constants.DEVICE_OWNER_ROUTER_GW)
|
constants.DEVICE_OWNER_ROUTER_GW)
|
||||||
result = h_info.UtifInfo(vlan=network_binding["segmentation_id"],
|
network_type = network.get('provider:network_type')
|
||||||
network_name=network["name"],
|
if network_type != 'vlan':
|
||||||
network_id=network["id"],
|
raise exc.UtifInfoError(
|
||||||
is_gw=is_gw,
|
err_msg=_("Network type %s not supported. Please be sure "
|
||||||
owner_tenant=network["tenant_id"],
|
"that tenant_network_type is vlan") % network_type)
|
||||||
port_id=neutron_port["id"],
|
result = h_info.UtifInfo(network.get('provider:segmentation_id'),
|
||||||
mac_address=neutron_port["mac_address"])
|
network['name'],
|
||||||
|
network['id'],
|
||||||
|
is_gw,
|
||||||
|
network['tenant_id'],
|
||||||
|
neutron_port['id'],
|
||||||
|
neutron_port['mac_address'])
|
||||||
return result
|
return result
|
@ -1,16 +0,0 @@
|
|||||||
# Copyright 2013 Embrane, 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.
|
|
||||||
#
|
|
||||||
# @author: Ivar Lazzaro, Embrane, Inc.
|
|
@ -1,4 +1,4 @@
|
|||||||
# Copyright 2013 Embrane, Inc.
|
# Copyright 2014 Embrane, Inc.
|
||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
@ -14,23 +14,31 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
# @author: Ivar Lazzaro, Embrane, Inc.
|
# @author: Ivar Lazzaro, Embrane, Inc.
|
||||||
|
# @author: Ignacio Scopetta, Embrane, Inc.
|
||||||
|
|
||||||
|
from neutron.db import extraroute_db
|
||||||
|
from neutron.db import l3_dvr_db
|
||||||
|
from neutron.db import l3_gwmode_db
|
||||||
from neutron.plugins.embrane import base_plugin as base
|
from neutron.plugins.embrane import base_plugin as base
|
||||||
from neutron.plugins.embrane.l2base.openvswitch import openvswitch_support
|
from neutron.plugins.embrane.l2base.ml2 import ml2_support
|
||||||
from neutron.plugins.openvswitch import ovs_neutron_plugin as l2
|
from neutron.plugins.ml2 import plugin as l2
|
||||||
|
|
||||||
|
|
||||||
class EmbraneOvsPlugin(base.EmbranePlugin, l2.OVSNeutronPluginV2):
|
class EmbraneMl2Plugin(base.EmbranePlugin, l2.Ml2Plugin,
|
||||||
'''EmbraneOvsPlugin.
|
l3_dvr_db.L3_NAT_with_dvr_db_mixin,
|
||||||
|
l3_gwmode_db.L3_NAT_db_mixin,
|
||||||
|
extraroute_db.ExtraRoute_db_mixin):
|
||||||
|
'''EmbraneMl2Plugin.
|
||||||
|
|
||||||
This plugin uses OpenVSwitch specific L2 plugin for providing L2 networks
|
This plugin uses Modular Layer 2 plugin for providing L2 networks
|
||||||
and the base EmbranePlugin for L3.
|
and the base EmbranePlugin for L3.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
_plugin_support = openvswitch_support.OpenvswitchSupport()
|
_plugin_support = ml2_support.Ml2Support()
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
'''First run plugin specific initialization, then Embrane's.'''
|
'''First run plugin specific initialization, then Embrane's.'''
|
||||||
self._supported_extension_aliases.remove("l3_agent_scheduler")
|
self._supported_extension_aliases.extend(["router", "extraroute",
|
||||||
l2.OVSNeutronPluginV2.__init__(self)
|
"ext-gw-mode"])
|
||||||
|
l2.Ml2Plugin.__init__(self)
|
||||||
self._run_embrane_config()
|
self._run_embrane_config()
|
@ -121,7 +121,7 @@ neutron.core_plugins =
|
|||||||
bigswitch = neutron.plugins.bigswitch.plugin:NeutronRestProxyV2
|
bigswitch = neutron.plugins.bigswitch.plugin:NeutronRestProxyV2
|
||||||
brocade = neutron.plugins.brocade.NeutronPlugin:BrocadePluginV2
|
brocade = neutron.plugins.brocade.NeutronPlugin:BrocadePluginV2
|
||||||
cisco = neutron.plugins.cisco.network_plugin:PluginV2
|
cisco = neutron.plugins.cisco.network_plugin:PluginV2
|
||||||
embrane = neutron.plugins.embrane.plugins.embrane_ovs_plugin:EmbraneOvsPlugin
|
embrane = neutron.plugins.embrane.plugins.embrane_ml2_plugin:EmbraneMl2Plugin
|
||||||
hyperv = neutron.plugins.hyperv.hyperv_neutron_plugin:HyperVNeutronPlugin
|
hyperv = neutron.plugins.hyperv.hyperv_neutron_plugin:HyperVNeutronPlugin
|
||||||
ibm = neutron.plugins.ibm.sdnve_neutron_plugin:SdnvePluginV2
|
ibm = neutron.plugins.ibm.sdnve_neutron_plugin:SdnvePluginV2
|
||||||
linuxbridge = neutron.plugins.linuxbridge.lb_neutron_plugin:LinuxBridgePluginV2
|
linuxbridge = neutron.plugins.linuxbridge.lb_neutron_plugin:LinuxBridgePluginV2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user