]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add L3 router plugin shim for Brocade MLX
authorAngela Smith <aallen@brocade.com>
Wed, 4 Mar 2015 23:59:23 +0000 (15:59 -0800)
committerAngela Smith <aallen@brocade.com>
Wed, 25 Mar 2015 20:59:35 +0000 (13:59 -0700)
Change-Id: I4eba6a3fb8ce2b22e0d142643d753ee2314425b8
Closes-Bug: #1428316

etc/neutron/plugins/brocade/brocade_mlx.ini [new file with mode: 0644]
neutron/services/l3_router/brocade/mlx/__init__.py [new file with mode: 0644]
neutron/services/l3_router/brocade/mlx/l3_router_plugin.py [new file with mode: 0644]
setup.cfg

diff --git a/etc/neutron/plugins/brocade/brocade_mlx.ini b/etc/neutron/plugins/brocade/brocade_mlx.ini
new file mode 100644 (file)
index 0000000..54d5414
--- /dev/null
@@ -0,0 +1,19 @@
+[l3_brocade_mlx]
+# switch_names = Comma separated list of names of MLX switches to be configured
+# Example:
+# switch_names = mlx
+
+# [EXAMPLE_SWITCH]
+# address  = The IP address of the MLX switch
+# username = The SSH username to use to connect to device
+# password = The SSH password to use to connect to device
+# physical_networks = Allowed physical networks for VLAN configuration
+# ports = Comma separated list of ports on the switch which needs to be tagged to VLAN
+#
+# Example:
+# [mlx]
+# address  = 10.24.20.21
+# username = admin
+# password = password
+# physical_networks = physnet1
+# ports = 3/3, 3/9
diff --git a/neutron/services/l3_router/brocade/mlx/__init__.py b/neutron/services/l3_router/brocade/mlx/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/neutron/services/l3_router/brocade/mlx/l3_router_plugin.py b/neutron/services/l3_router/brocade/mlx/l3_router_plugin.py
new file mode 100644 (file)
index 0000000..87f1e59
--- /dev/null
@@ -0,0 +1,50 @@
+# Copyright 2015 Brocade Communications 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.
+#
+"""Implementation of Brocade L3RouterPlugin for MLX switches."""
+
+from networking_brocade.mlx.services.l3_router.brocade import (
+    l3_router_plugin as plugin)
+from oslo_config import cfg
+
+SWITCHES = [
+    cfg.StrOpt(
+        'switch_names',
+        default='',
+        help=('Switches connected to the compute nodes'))]
+
+L3_BROCADE = [cfg.StrOpt('address', default='',
+                         help=('The IP address of the MLX switch')),
+              cfg.StrOpt('username', default='admin',
+                         help=('The SSH username of the switch')),
+              cfg.StrOpt('password', default='password', secret=True,
+                         help=('The SSH password of the switch')),
+              cfg.StrOpt('physical_networks', default='',
+                         help=('Allowed physical networks where VLAN can '
+                               'be configured on this switch')),
+              cfg.StrOpt('ports', default='',
+                         help=('Ports to be tagged in the VLAN being '
+                               'configured on the switch')),
+              ]
+cfg.CONF.register_opts(SWITCHES, 'l3_brocade_mlx')
+
+
+class BrocadeRouterPlugin(plugin.BrocadeRouterPlugin):
+    def __init__(self):
+        self._switch_names = cfg.CONF.l3_brocade_mlx.switch_names
+        switches = [x.strip() for x in self._switch_names.split(',')]
+        for switch in switches:
+            cfg.CONF.register_opts(L3_BROCADE, switch)
+        super(BrocadeRouterPlugin, self).__init__()
index 4f8588a4b291d8dff927663a28c9b9f3b555e08b..d668033c8ffcab14885a70252d4fffea721a41ac 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -46,7 +46,9 @@ data_files =
         etc/neutron/plugins/bigswitch/ssl/ca_certs/README
     etc/neutron/plugins/bigswitch/ssl/host_certs =
         etc/neutron/plugins/bigswitch/ssl/host_certs/README
-    etc/neutron/plugins/brocade = etc/neutron/plugins/brocade/brocade.ini
+    etc/neutron/plugins/brocade =
+        etc/neutron/plugins/brocade/brocade.ini
+        etc/neutron/plugins/brocade/brocade_mlx.ini
     etc/neutron/plugins/brocade/vyatta = etc/neutron/plugins/brocade/vyatta/vrouter.ini
     etc/neutron/plugins/cisco =
         etc/neutron/plugins/cisco/cisco_cfg_agent.ini
@@ -132,6 +134,7 @@ neutron.service_plugins =
     router = neutron.services.l3_router.l3_router_plugin:L3RouterPlugin
     bigswitch_l3 = neutron.plugins.bigswitch.l3_router_plugin:L3RestProxy
     brocade_vyatta_l3 = neutron.services.l3_router.brocade.vyatta.vrouter_neutron_plugin.VyattaVRouterPlugin
+    brocade_mlx_l3 = neutron.services.l3_router.brocade.mlx.l3_router_plugin:BrocadeRouterPlugin
     firewall = neutron_fwaas.services.firewall.fwaas_plugin:FirewallPlugin
     fsl_firewall = neutron_fwaas.services.firewall.freescale.fwaas_plugin:FirewallPlugin
     lbaas = neutron_lbaas.services.loadbalancer.plugin:LoadBalancerPlugin