Browse Source

3.2 Cumulus Linux release changes

Changes in this commit
-   Renamed the repo to networking-cumulus and the package to networking_Cumulus
-   Addition of caching and replaying of the configuration using the neutron database.
-   Additional configurable parameters to control sync timer, spf and to create vlan aware/non aware bridges. These can be configured at global level and not per switch.
-   Addition of Vxlan type driver support
-   Added Internationalization (I18n) support
-   Used cookiecutter template to prepare the repo for openstack.
radhika 2 years ago
parent
commit
9f32b81af3
73 changed files with 3287 additions and 249 deletions
  1. 6
    0
      .coveragerc
  2. 8
    0
      .testr.conf
  3. 17
    0
      CONTRIBUTING.rst
  4. 4
    0
      HACKING.rst
  5. 176
    0
      LICENSE
  6. 6
    0
      MANIFEST.in
  7. 2
    0
      babel.cfg
  8. 0
    14
      cumulus_ml2/mech_driver/config.py
  9. 0
    192
      cumulus_ml2/mech_driver/driver.py
  10. 0
    13
      cumulus_ml2/utils/misc.py
  11. 3
    3
      debian/changelog
  12. 5
    5
      debian/control
  13. 0
    3
      debian/cumulus-ml2-driver.install
  14. 3
    0
      debian/networking-cumulus.install
  15. 1
    1
      debian/rules
  16. 75
    0
      doc/source/conf.py
  17. 4
    0
      doc/source/contributing.rst
  18. 25
    0
      doc/source/index.rst
  19. 12
    0
      doc/source/installation.rst
  20. 1
    0
      doc/source/readme.rst
  21. 7
    0
      doc/source/usage.rst
  22. 2
    0
      etc/neutron/plugins/ml2/ml2_conf_cumulus.ini
  23. BIN
      images/deb/cumulus-ml2-driver_1.0.0-cl3eau1_all.deb
  24. BIN
      images/deb/networking-cumulus_1.0.0-cl3eau1_all.deb
  25. BIN
      images/rpm/cumulus-ml2-driver-1.0.0.dev8-1.noarch.rpm
  26. BIN
      images/rpm/cumulus-ml2-driver-1.0.0.dev8-1.src.rpm
  27. BIN
      images/rpm/networking-cumulus-1.0.0.dev9-1.noarch.rpm
  28. BIN
      images/rpm/networking-cumulus-1.0.0.dev9-1.src.rpm
  29. BIN
      images/rpm/networking-cumulus-1.0.0.dev9.tar.gz
  30. 20
    0
      images/rpm/networking_cumulus.egg-info/PKG-INFO
  31. 72
    0
      images/rpm/networking_cumulus.egg-info/SOURCES.txt
  32. 1
    0
      images/rpm/networking_cumulus.egg-info/dependency_links.txt
  33. 6
    0
      images/rpm/networking_cumulus.egg-info/entry_points.txt
  34. 1
    0
      images/rpm/networking_cumulus.egg-info/not-zip-safe
  35. 1
    0
      images/rpm/networking_cumulus.egg-info/pbr.json
  36. 1
    0
      images/rpm/networking_cumulus.egg-info/requires.txt
  37. 1
    0
      images/rpm/networking_cumulus.egg-info/top_level.txt
  38. 0
    0
      networking_cumulus/__init__.py
  39. 42
    0
      networking_cumulus/_i18n.py
  40. 0
    0
      networking_cumulus/db/__init__.py
  41. 0
    0
      networking_cumulus/db/migration/__init__.py
  42. 0
    0
      networking_cumulus/db/migration/alembic_migrations/__init__.py
  43. 125
    0
      networking_cumulus/db/migration/alembic_migrations/env.py
  44. 21
    0
      networking_cumulus/db/migration/alembic_migrations/script.py.mako
  45. 65
    0
      networking_cumulus/db/migration/alembic_migrations/versions/1134a7f4c7e5_cumulus_init_ops.py
  46. 1
    0
      networking_cumulus/db/migration/alembic_migrations/versions/HEAD
  47. 0
    0
      networking_cumulus/db/migration/models/__init__.py
  48. 21
    0
      networking_cumulus/db/migration/models/head.py
  49. 0
    0
      networking_cumulus/mech_driver/__init__.py
  50. 45
    0
      networking_cumulus/mech_driver/config.py
  51. 136
    0
      networking_cumulus/mech_driver/db.py
  52. 614
    0
      networking_cumulus/mech_driver/driver.py
  53. 26
    8
      networking_cumulus/mech_driver/hpb_bridge_agent.py
  54. 84
    0
      networking_cumulus/mech_driver/models.py
  55. 0
    0
      networking_cumulus/tests/__init__.py
  56. 23
    0
      networking_cumulus/tests/base.py
  57. 28
    0
      networking_cumulus/tests/test_networking_cumulus.py
  58. 0
    0
      networking_cumulus/tests/unit/__init__.py
  59. 0
    0
      networking_cumulus/tests/unit/ml2/__init__.py
  60. 1143
    0
      networking_cumulus/tests/unit/ml2/test_cumulus_mech.py
  61. 0
    0
      networking_cumulus/utils/__init__.py
  62. 28
    6
      networking_cumulus/utils/discovery.py
  63. 30
    0
      networking_cumulus/utils/misc.py
  64. 0
    0
      releasenotes/notes/.placeholder
  65. 0
    0
      releasenotes/source/_static/.placeholder
  66. 0
    0
      releasenotes/source/_templates/.placeholder
  67. 275
    0
      releasenotes/source/conf.py
  68. 8
    0
      releasenotes/source/index.rst
  69. 5
    0
      releasenotes/source/unreleased.rst
  70. 5
    0
      requirements.txt
  71. 40
    4
      setup.cfg
  72. 17
    0
      test-requirements.txt
  73. 45
    0
      tox.ini

+ 6
- 0
.coveragerc View File

@@ -0,0 +1,6 @@
1
+[run]
2
+branch = True
3
+source = cumulus-ml2
4
+
5
+[report]
6
+ignore_errors = True

+ 8
- 0
.testr.conf View File

@@ -0,0 +1,8 @@
1
+[DEFAULT]
2
+test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
3
+             OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
4
+             OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
5
+             OS_LOG_CAPTURE=1 \
6
+             ${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
7
+test_id_option=--load-list $IDFILE
8
+test_list_option=--list

+ 17
- 0
CONTRIBUTING.rst View File

@@ -0,0 +1,17 @@
1
+If you would like to contribute to the development of OpenStack, you must
2
+follow the steps in this page:
3
+
4
+   http://docs.openstack.org/infra/manual/developers.html
5
+
6
+If you already have a good understanding of how the system works and your
7
+OpenStack accounts are set up, you can skip to the development workflow
8
+section of this documentation to learn how changes to OpenStack should be
9
+submitted for review via the Gerrit tool:
10
+
11
+   http://docs.openstack.org/infra/manual/developers.html#development-workflow
12
+
13
+Pull requests submitted through GitHub will be ignored.
14
+
15
+Bugs should be filed on Launchpad, not GitHub:
16
+
17
+   https://bugs.launchpad.net/networking-cumulus

+ 4
- 0
HACKING.rst View File

@@ -0,0 +1,4 @@
1
+networking-cumulus Style Commandments
2
+=====================================
3
+
4
+Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

+ 176
- 0
LICENSE View File

@@ -0,0 +1,176 @@
1
+
2
+                                 Apache License
3
+                           Version 2.0, January 2004
4
+                        http://www.apache.org/licenses/
5
+
6
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+   1. Definitions.
9
+
10
+      "License" shall mean the terms and conditions for use, reproduction,
11
+      and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+      "Licensor" shall mean the copyright owner or entity authorized by
14
+      the copyright owner that is granting the License.
15
+
16
+      "Legal Entity" shall mean the union of the acting entity and all
17
+      other entities that control, are controlled by, or are under common
18
+      control with that entity. For the purposes of this definition,
19
+      "control" means (i) the power, direct or indirect, to cause the
20
+      direction or management of such entity, whether by contract or
21
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+      outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+      "You" (or "Your") shall mean an individual or Legal Entity
25
+      exercising permissions granted by this License.
26
+
27
+      "Source" form shall mean the preferred form for making modifications,
28
+      including but not limited to software source code, documentation
29
+      source, and configuration files.
30
+
31
+      "Object" form shall mean any form resulting from mechanical
32
+      transformation or translation of a Source form, including but
33
+      not limited to compiled object code, generated documentation,
34
+      and conversions to other media types.
35
+
36
+      "Work" shall mean the work of authorship, whether in Source or
37
+      Object form, made available under the License, as indicated by a
38
+      copyright notice that is included in or attached to the work
39
+      (an example is provided in the Appendix below).
40
+
41
+      "Derivative Works" shall mean any work, whether in Source or Object
42
+      form, that is based on (or derived from) the Work and for which the
43
+      editorial revisions, annotations, elaborations, or other modifications
44
+      represent, as a whole, an original work of authorship. For the purposes
45
+      of this License, Derivative Works shall not include works that remain
46
+      separable from, or merely link (or bind by name) to the interfaces of,
47
+      the Work and Derivative Works thereof.
48
+
49
+      "Contribution" shall mean any work of authorship, including
50
+      the original version of the Work and any modifications or additions
51
+      to that Work or Derivative Works thereof, that is intentionally
52
+      submitted to Licensor for inclusion in the Work by the copyright owner
53
+      or by an individual or Legal Entity authorized to submit on behalf of
54
+      the copyright owner. For the purposes of this definition, "submitted"
55
+      means any form of electronic, verbal, or written communication sent
56
+      to the Licensor or its representatives, including but not limited to
57
+      communication on electronic mailing lists, source code control systems,
58
+      and issue tracking systems that are managed by, or on behalf of, the
59
+      Licensor for the purpose of discussing and improving the Work, but
60
+      excluding communication that is conspicuously marked or otherwise
61
+      designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+      "Contributor" shall mean Licensor and any individual or Legal Entity
64
+      on behalf of whom a Contribution has been received by Licensor and
65
+      subsequently incorporated within the Work.
66
+
67
+   2. Grant of Copyright License. Subject to the terms and conditions of
68
+      this License, each Contributor hereby grants to You a perpetual,
69
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+      copyright license to reproduce, prepare Derivative Works of,
71
+      publicly display, publicly perform, sublicense, and distribute the
72
+      Work and such Derivative Works in Source or Object form.
73
+
74
+   3. Grant of Patent License. Subject to the terms and conditions of
75
+      this License, each Contributor hereby grants to You a perpetual,
76
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+      (except as stated in this section) patent license to make, have made,
78
+      use, offer to sell, sell, import, and otherwise transfer the Work,
79
+      where such license applies only to those patent claims licensable
80
+      by such Contributor that are necessarily infringed by their
81
+      Contribution(s) alone or by combination of their Contribution(s)
82
+      with the Work to which such Contribution(s) was submitted. If You
83
+      institute patent litigation against any entity (including a
84
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+      or a Contribution incorporated within the Work constitutes direct
86
+      or contributory patent infringement, then any patent licenses
87
+      granted to You under this License for that Work shall terminate
88
+      as of the date such litigation is filed.
89
+
90
+   4. Redistribution. You may reproduce and distribute copies of the
91
+      Work or Derivative Works thereof in any medium, with or without
92
+      modifications, and in Source or Object form, provided that You
93
+      meet the following conditions:
94
+
95
+      (a) You must give any other recipients of the Work or
96
+          Derivative Works a copy of this License; and
97
+
98
+      (b) You must cause any modified files to carry prominent notices
99
+          stating that You changed the files; and
100
+
101
+      (c) You must retain, in the Source form of any Derivative Works
102
+          that You distribute, all copyright, patent, trademark, and
103
+          attribution notices from the Source form of the Work,
104
+          excluding those notices that do not pertain to any part of
105
+          the Derivative Works; and
106
+
107
+      (d) If the Work includes a "NOTICE" text file as part of its
108
+          distribution, then any Derivative Works that You distribute must
109
+          include a readable copy of the attribution notices contained
110
+          within such NOTICE file, excluding those notices that do not
111
+          pertain to any part of the Derivative Works, in at least one
112
+          of the following places: within a NOTICE text file distributed
113
+          as part of the Derivative Works; within the Source form or
114
+          documentation, if provided along with the Derivative Works; or,
115
+          within a display generated by the Derivative Works, if and
116
+          wherever such third-party notices normally appear. The contents
117
+          of the NOTICE file are for informational purposes only and
118
+          do not modify the License. You may add Your own attribution
119
+          notices within Derivative Works that You distribute, alongside
120
+          or as an addendum to the NOTICE text from the Work, provided
121
+          that such additional attribution notices cannot be construed
122
+          as modifying the License.
123
+
124
+      You may add Your own copyright statement to Your modifications and
125
+      may provide additional or different license terms and conditions
126
+      for use, reproduction, or distribution of Your modifications, or
127
+      for any such Derivative Works as a whole, provided Your use,
128
+      reproduction, and distribution of the Work otherwise complies with
129
+      the conditions stated in this License.
130
+
131
+   5. Submission of Contributions. Unless You explicitly state otherwise,
132
+      any Contribution intentionally submitted for inclusion in the Work
133
+      by You to the Licensor shall be under the terms and conditions of
134
+      this License, without any additional terms or conditions.
135
+      Notwithstanding the above, nothing herein shall supersede or modify
136
+      the terms of any separate license agreement you may have executed
137
+      with Licensor regarding such Contributions.
138
+
139
+   6. Trademarks. This License does not grant permission to use the trade
140
+      names, trademarks, service marks, or product names of the Licensor,
141
+      except as required for reasonable and customary use in describing the
142
+      origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+   7. Disclaimer of Warranty. Unless required by applicable law or
145
+      agreed to in writing, Licensor provides the Work (and each
146
+      Contributor provides its Contributions) on an "AS IS" BASIS,
147
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+      implied, including, without limitation, any warranties or conditions
149
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+      PARTICULAR PURPOSE. You are solely responsible for determining the
151
+      appropriateness of using or redistributing the Work and assume any
152
+      risks associated with Your exercise of permissions under this License.
153
+
154
+   8. Limitation of Liability. In no event and under no legal theory,
155
+      whether in tort (including negligence), contract, or otherwise,
156
+      unless required by applicable law (such as deliberate and grossly
157
+      negligent acts) or agreed to in writing, shall any Contributor be
158
+      liable to You for damages, including any direct, indirect, special,
159
+      incidental, or consequential damages of any character arising as a
160
+      result of this License or out of the use or inability to use the
161
+      Work (including but not limited to damages for loss of goodwill,
162
+      work stoppage, computer failure or malfunction, or any and all
163
+      other commercial damages or losses), even if such Contributor
164
+      has been advised of the possibility of such damages.
165
+
166
+   9. Accepting Warranty or Additional Liability. While redistributing
167
+      the Work or Derivative Works thereof, You may choose to offer,
168
+      and charge a fee for, acceptance of support, warranty, indemnity,
169
+      or other liability obligations and/or rights consistent with this
170
+      License. However, in accepting such obligations, You may act only
171
+      on Your own behalf and on Your sole responsibility, not on behalf
172
+      of any other Contributor, and only if You agree to indemnify,
173
+      defend, and hold each Contributor harmless for any liability
174
+      incurred by, or claims asserted against, such Contributor by reason
175
+      of your accepting any such warranty or additional liability.
176
+

+ 6
- 0
MANIFEST.in View File

@@ -0,0 +1,6 @@
1
+include AUTHORS
2
+include ChangeLog
3
+exclude .gitignore
4
+exclude .gitreview
5
+
6
+global-exclude *.pyc

+ 2
- 0
babel.cfg View File

@@ -0,0 +1,2 @@
1
+[python: **.py]
2
+

+ 0
- 14
cumulus_ml2/mech_driver/config.py View File

@@ -1,14 +0,0 @@
1
-from oslo_config import cfg
2
-
3
-CUMULUS_DRIVER_OPTS = [
4
-    cfg.StrOpt('scheme',
5
-               default='http',
6
-               help='Scheme for base URL for the Cumulus ML2 API'),
7
-    cfg.IntOpt('protocol_port',
8
-               default='8000',
9
-               help='Protocol port for base URL for the Cumulus ML2 API'),
10
-    cfg.ListOpt('switches', default=[],
11
-                help=_('list of switch name/ip and remote switch port connected to this compute node'))
12
-]
13
-
14
-cfg.CONF.register_opts(CUMULUS_DRIVER_OPTS, 'ml2_cumulus')

+ 0
- 192
cumulus_ml2/mech_driver/driver.py View File

@@ -1,192 +0,0 @@
1
-import json
2
-
3
-from oslo_config import cfg
4
-from oslo_log import log as logging
5
-import requests
6
-from requests.exceptions import HTTPError
7
-
8
-from neutron.extensions import portbindings
9
-from neutron.i18n import _LE, _LI, _LW
10
-from neutron.plugins.ml2.common.exceptions import MechanismDriverError
11
-from neutron.plugins.ml2.driver_api import MechanismDriver
12
-
13
-from cumulus_ml2.mech_driver import config
14
-
15
-LOG = logging.getLogger(__name__)
16
-NETWORKS_URL = '{scheme}://{base}:{port}/ml2/v1/networks/{network}'
17
-HOSTS_URL = '{scheme}://{base}:{port}/ml2/v1/networks/{network}/hosts/{host}'
18
-VXLAN_URL = '{scheme}://{base}:{port}/ml2/v1/networks/{network}/vxlan/{vni}'
19
-
20
-"""
21
-
22
-list of switches is required to be configured. Add this config to the ml2_conf.ini config
23
-switche names or IPs must be separated using comma.
24
-
25
-[ml2_cumulus]
26
-switches="192.168.10.10,192.168.20.20"
27
-"""
28
-
29
-class CumulusMechanismDriver(MechanismDriver):
30
-    """
31
-    Mechanism driver for Cumulus Linux that manages connectivity between switches
32
-    and (compute) hosts using the Cumulus API
33
-    """
34
-    def initialize(self):
35
-        self.scheme = cfg.CONF.ml2_cumulus.scheme
36
-        self.protocol_port = cfg.CONF.ml2_cumulus.protocol_port
37
-        self.switches = cfg.CONF.ml2_cumulus.switches
38
-        if self.switches:
39
-            LOG.info(_LI('switches found in ml2_conf files %s'), self.switches)
40
-        else:
41
-            LOG.info(_LI('no switches in ml2_conf files'))
42
-
43
-    def bind_port(self, context):
44
-        if context.binding_levels:
45
-            return  # we've already got a top binding
46
-
47
-        # assign a dynamic vlan
48
-        next_segment = context.allocate_dynamic_segment(
49
-            {'id': context.network.current, 'network_type': 'vlan'}
50
-        )
51
-
52
-        context.continue_binding(
53
-            context.segments_to_bind[0]['id'],
54
-            [next_segment]
55
-        )
56
-
57
-    def delete_network_postcommit(self, context):
58
-        network_id = context.current['id']
59
-        vni = context.current['provider:segmentation_id']
60
-
61
-        # remove vxlan from all hosts - a little unpleasant
62
-        for _switch_ip in self.switches:
63
-
64
-            r = requests.delete(
65
-                VXLAN_URL.format(
66
-                    scheme=self.scheme,
67
-                    base=_switch_ip,
68
-                    port=self.protocol_port,
69
-                    network=network_id,
70
-                    vni=vni
71
-                )
72
-            )
73
-
74
-            if r.status_code != requests.codes.ok:
75
-                LOG.info(
76
-                    _LI('Error during vxlan delete. HTTP Error:%d'),
77
-                    r.status_code
78
-                )
79
-
80
-            r = requests.delete(
81
-                NETWORKS_URL.format(
82
-                    scheme=self.scheme,
83
-                    base=_switch_ip,
84
-                    port=self.protocol_port,
85
-                    network=network_id
86
-                )
87
-            )
88
-
89
-            if r.status_code != requests.codes.ok:
90
-                LOG.info(
91
-                    _LI('Error during network delete. HTTP Error:%d'),
92
-                    r.status_code
93
-                )
94
-
95
-    def create_port_postcommit(self, context):
96
-        if context.segments_to_bind:
97
-            self._add_to_switch(context)
98
-
99
-    def update_port_postcommit(self, context):
100
-        if context.host != context.original_host:
101
-            self._remove_from_switch(context.original)
102
-        self._add_to_switch(context)
103
-
104
-    def delete_port_postcommit(self, context):
105
-        self._remove_from_switch(context)
106
-
107
-    def _add_to_switch(self, context):
108
-        if not hasattr(context, 'current'):
109
-            return
110
-        port = context.current
111
-        device_id = port['device_id']
112
-        device_owner = port['device_owner']
113
-        host = port[portbindings.HOST_ID]
114
-        network_id = port['network_id']
115
-        if not hasattr(context, 'top_bound_segment'):
116
-            return
117
-        if not context.top_bound_segment:
118
-            return
119
-        vni = context.top_bound_segment['segmentation_id']
120
-        vlan = context.bottom_bound_segment['segmentation_id']
121
-
122
-        if not (host and device_id and device_owner):
123
-            return
124
-
125
-
126
-        for _switch_ip in self.switches:
127
-            r = requests.put(
128
-                NETWORKS_URL.format(
129
-                    scheme=self.scheme,
130
-                    base=_switch_ip,
131
-                    port=self.protocol_port,
132
-                    network=network_id
133
-                ),
134
-                data=json.dumps({'vlan': vlan})
135
-            )
136
-
137
-            if r.status_code != requests.codes.ok:
138
-                raise MechanismDriverError()
139
-
140
-            actions = [
141
-                HOSTS_URL.format(
142
-                    scheme=self.scheme,
143
-                    base=_switch_ip,
144
-                    port=self.protocol_port,
145
-                    network=network_id,
146
-                    host=host
147
-                ),
148
-            ]
149
-            if context.top_bound_segment != context.bottom_bound_segment:
150
-                actions.append(
151
-                    VXLAN_URL.format(
152
-                        scheme=self.scheme,
153
-                        base=_switch_ip,
154
-                        port=self.protocol_port,
155
-                        network=network_id,
156
-                        vni=vni
157
-                    )
158
-                )
159
-
160
-
161
-            for action in actions:
162
-                r = requests.put(action)
163
-
164
-                if r.status_code != requests.codes.ok:
165
-                    raise MechanismDriverError()
166
-
167
-    def _remove_from_switch(self, context):
168
-        if not hasattr(context, 'current'):
169
-            return
170
-        port = context.current
171
-        host = port[portbindings.HOST_ID]
172
-        network_id = port['network_id']
173
-
174
-        for _switch_ip in self.switches:
175
-
176
-            r = requests.delete(
177
-                HOSTS_URL.format(
178
-                    scheme=self.scheme,
179
-                    base=_switch_ip,
180
-                    port=self.protocol_port,
181
-                    network=network_id,
182
-                    host=host
183
-                )
184
-            )
185
-
186
-            if r.status_code != requests.codes.ok:
187
-                LOG.info(
188
-                    _LI('error (%d) deleting port for %s on switch: %s'),
189
-                    r.status_code,
190
-                    host,
191
-                    _switch_ip
192
-                )

+ 0
- 13
cumulus_ml2/utils/misc.py View File

@@ -1,13 +0,0 @@
1
-from subprocess import check_output
2
-import yaml
3
-
4
-def load_config(path):
5
-    with open(path) as fp:
6
-        return yaml.load(fp)
7
-
8
-class Shell(object):
9
-    def __init__(self, root_helper):
10
-        self.root_helper = root_helper
11
-
12
-    def call(self, args):
13
-        return check_output([self.root_helper] + args)

+ 3
- 3
debian/changelog View File

@@ -1,5 +1,5 @@
1
-cumulus-ml2 (1.0.0-cl3eau1) RELEASED; urgency=low
1
+networking-cumulus (1.0.0-cl3eau1) UNRELEASED; urgency=medium
2 2
 
3
-  * Initial release
3
+  * Initial release. (Closes: #XXXXXX)
4 4
 
5
- -- dev-support <dev-support@cumulusnetworks.com>  Wed, 22 June 2016 20:10:36 +0000
5
+ -- dev-support <dev-support@cumulusnetworks.com>  Fri, 09 Dec 2016 14:28:58 -0800

+ 5
- 5
debian/control View File

@@ -1,4 +1,4 @@
1
-Source: cumulus-ml2
1
+Source: networking-cumulus
2 2
 Section: net
3 3
 Priority: extra
4 4
 Maintainer: dev-support <dev-support@cumulusnetworks.com>
@@ -8,13 +8,13 @@ Build-Depends:
8 8
 	python-setuptools
9 9
 Standards-Version: 3.9.3
10 10
 X-Python-Version: >= 2.7
11
-#Vcs-Git: git://git.debian.org/collab-maint/cumulus-ml2.git
12
-#Vcs-Browser: http://git.debian.org/?p=collab-maint/cumulus-ml2.git;a=summary
11
+#Vcs-Git: git://git.debian.org/collab-maint/networking-cumulus.git
12
+#Vcs-Browser: http://git.debian.org/?p=collab-maint/networking-cumulus.git;a=summary
13 13
 
14
-Package: cumulus-ml2-driver
14
+Package: networking-cumulus
15 15
 Architecture: all
16 16
 Depends: ${python:Depends}, ${misc:Depends}
17 17
 Description: Mechanism ML2 Driver for Cumulus ML2 Plugin
18 18
  This is installed on the network node where the Neutron server runs.
19
- The configuration file located in /etc/neutron/plugins/ml2/ml2_cumulus.ini
19
+ The configuration file located in /etc/neutron/plugins/ml2/ml2_conf_cumulus.ini
20 20
  has sample configs and short help section.

+ 0
- 3
debian/cumulus-ml2-driver.install View File

@@ -1,3 +0,0 @@
1
-debian/cumulus-ml2-driver/usr/lib/python2.7/dist-packages/cumulus_ml2/mech_driver/*.py
2
-debian/cumulus-ml2-driver/usr/lib/python2.7/dist-packages/cumulus_ml2/utils/*.py
3
-debian/cumulus-ml2-driver/usr/lib/python2.7/dist-packages/cumulus*.egg-info/*

+ 3
- 0
debian/networking-cumulus.install View File

@@ -0,0 +1,3 @@
1
+debian/networking-cumulus/usr/lib/python2.7/dist-packages/networking_cumulus/mech_driver/*.py
2
+debian/networking-cumulus/usr/lib/python2.7/dist-packages/networking_cumulus/utils/*.py
3
+debian/networking-cumulus/usr/lib/python2.7/dist-packages/networking_cumulus*.egg-info/*

+ 1
- 1
debian/rules View File

@@ -26,7 +26,7 @@ endif
26 26
 override_dh_auto_install:
27 27
 	set -e && for pyvers in $(shell pyversions -r); do \
28 28
 		$$pyvers setup.py install --install-layout=deb \
29
-		--root $(CURDIR)/debian/cumulus-ml2-driver; \
29
+		--root $(CURDIR)/debian/networking-cumulus; \
30 30
 	done
31 31
 
32 32
 override_dh_clean:

+ 75
- 0
doc/source/conf.py View File

@@ -0,0 +1,75 @@
1
+# -*- coding: utf-8 -*-
2
+# Licensed under the Apache License, Version 2.0 (the "License");
3
+# you may not use this file except in compliance with the License.
4
+# You may obtain a copy of the License at
5
+#
6
+#    http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+# Unless required by applicable law or agreed to in writing, software
9
+# distributed under the License is distributed on an "AS IS" BASIS,
10
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11
+# implied.
12
+# See the License for the specific language governing permissions and
13
+# limitations under the License.
14
+
15
+import os
16
+import sys
17
+
18
+sys.path.insert(0, os.path.abspath('../..'))
19
+# -- General configuration ----------------------------------------------------
20
+
21
+# Add any Sphinx extension module names here, as strings. They can be
22
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
23
+extensions = [
24
+    'sphinx.ext.autodoc',
25
+    #'sphinx.ext.intersphinx',
26
+    'oslosphinx'
27
+]
28
+
29
+# autodoc generation is a bit aggressive and a nuisance when doing heavy
30
+# text edit cycles.
31
+# execute "export SPHINX_DEBUG=1" in your terminal to disable
32
+
33
+# The suffix of source filenames.
34
+source_suffix = '.rst'
35
+
36
+# The master toctree document.
37
+master_doc = 'index'
38
+
39
+# General information about the project.
40
+project = u'networking-cumulus'
41
+copyright = u'2016, OpenStack Foundation'
42
+
43
+# If true, '()' will be appended to :func: etc. cross-reference text.
44
+add_function_parentheses = True
45
+
46
+# If true, the current module name will be prepended to all description
47
+# unit titles (such as .. function::).
48
+add_module_names = True
49
+
50
+# The name of the Pygments (syntax highlighting) style to use.
51
+pygments_style = 'sphinx'
52
+
53
+# -- Options for HTML output --------------------------------------------------
54
+
55
+# The theme to use for HTML and HTML Help pages.  Major themes that come with
56
+# Sphinx are currently 'default' and 'sphinxdoc'.
57
+# html_theme_path = ["."]
58
+# html_theme = '_theme'
59
+# html_static_path = ['static']
60
+
61
+# Output file base name for HTML help builder.
62
+htmlhelp_basename = '%sdoc' % project
63
+
64
+# Grouping the document tree into LaTeX files. List of tuples
65
+# (source start file, target name, title, author, documentclass
66
+# [howto/manual]).
67
+latex_documents = [
68
+    ('index',
69
+     '%s.tex' % project,
70
+     u'%s Documentation' % project,
71
+     u'OpenStack Foundation', 'manual'),
72
+]
73
+
74
+# Example configuration for intersphinx: refer to the Python standard library.
75
+#intersphinx_mapping = {'http://docs.python.org/': None}

+ 4
- 0
doc/source/contributing.rst View File

@@ -0,0 +1,4 @@
1
+============
2
+Contributing
3
+============
4
+.. include:: ../../CONTRIBUTING.rst

+ 25
- 0
doc/source/index.rst View File

@@ -0,0 +1,25 @@
1
+.. networking-cumulus documentation master file, created by
2
+   sphinx-quickstart on Tue Jul  9 22:26:36 2013.
3
+   You can adapt this file completely to your liking, but it should at least
4
+   contain the root `toctree` directive.
5
+
6
+Welcome to networking-cumulus's documentation!
7
+========================================================
8
+
9
+Contents:
10
+
11
+.. toctree::
12
+   :maxdepth: 2
13
+
14
+   readme
15
+   installation
16
+   usage
17
+   contributing
18
+
19
+Indices and tables
20
+==================
21
+
22
+* :ref:`genindex`
23
+* :ref:`modindex`
24
+* :ref:`search`
25
+

+ 12
- 0
doc/source/installation.rst View File

@@ -0,0 +1,12 @@
1
+============
2
+Installation
3
+============
4
+
5
+At the command line::
6
+
7
+    $ pip install networking-cumulus
8
+
9
+Or, if you have virtualenvwrapper installed::
10
+
11
+    $ mkvirtualenv networking-cumulus
12
+    $ pip install networking-cumulus

+ 1
- 0
doc/source/readme.rst View File

@@ -0,0 +1 @@
1
+.. include:: ../../README.rst

+ 7
- 0
doc/source/usage.rst View File

@@ -0,0 +1,7 @@
1
+========
2
+Usage
3
+========
4
+
5
+To use networking-cumulus in a project::
6
+
7
+    import networking-cumulus

etc/neutron/plugins/ml2/ml2_cumulus.ini → etc/neutron/plugins/ml2/ml2_conf_cumulus.ini View File

@@ -1,3 +1,5 @@
1
+# Defines configuration options for Cumulus ML2 mechanism driver
2
+
1 3
 [ml2_cumulus]
2 4
 # Example attribute to set.
3 5
 # Make sure LLDP is work between the compute and switches since port

BIN
images/deb/cumulus-ml2-driver_1.0.0-cl3eau1_all.deb View File


BIN
images/deb/networking-cumulus_1.0.0-cl3eau1_all.deb View File


BIN
images/rpm/cumulus-ml2-driver-1.0.0.dev8-1.noarch.rpm View File


BIN
images/rpm/cumulus-ml2-driver-1.0.0.dev8-1.src.rpm View File


BIN
images/rpm/networking-cumulus-1.0.0.dev9-1.noarch.rpm View File


BIN
images/rpm/networking-cumulus-1.0.0.dev9-1.src.rpm View File


BIN
images/rpm/networking-cumulus-1.0.0.dev9.tar.gz View File


+ 20
- 0
images/rpm/networking_cumulus.egg-info/PKG-INFO View File

@@ -0,0 +1,20 @@
1
+Metadata-Version: 1.1
2
+Name: networking-cumulus
3
+Version: 1.0.0.dev9
4
+Summary: Cumulus ML2 driver
5
+Home-page: UNKNOWN
6
+Author: Cumulus Networks
7
+Author-email: cumulus-ml2@cumulusnetworks.com
8
+License: UNKNOWN
9
+Description: 
10
+        
11
+        
12
+Platform: UNKNOWN
13
+Classifier: Environment :: OpenStack
14
+Classifier: Intended Audience :: Information Technology
15
+Classifier: Intended Audience :: System Administrators
16
+Classifier: License :: OSI Approved :: Apache Software License
17
+Classifier: Operating System :: POSIX :: Linux
18
+Classifier: Programming Language :: Python
19
+Classifier: Programming Language :: Python :: 2
20
+Classifier: Programming Language :: Python :: 2.7

+ 72
- 0
images/rpm/networking_cumulus.egg-info/SOURCES.txt View File

@@ -0,0 +1,72 @@
1
+.coveragerc
2
+.testr.conf
3
+CONTRIBUTING.rst
4
+HACKING.rst
5
+LICENSE
6
+MANIFEST.in
7
+README.md
8
+babel.cfg
9
+requirements.txt
10
+setup.cfg
11
+setup.py
12
+test-requirements.txt
13
+tox.ini
14
+debian/changelog
15
+debian/compat
16
+debian/control
17
+debian/docs
18
+debian/networking-cumulus.install
19
+debian/rules
20
+debian/source/format
21
+debian/source/options
22
+doc/source/conf.py
23
+doc/source/contributing.rst
24
+doc/source/index.rst
25
+doc/source/installation.rst
26
+doc/source/readme.rst
27
+doc/source/usage.rst
28
+etc/neutron/plugins/ml2/ml2_conf_cumulus.ini
29
+images/deb/cumulus-ml2-driver_1.0.0-cl3eau1_all.deb
30
+images/rpm/cumulus-ml2-driver-1.0.0.dev8-1.noarch.rpm
31
+images/rpm/cumulus-ml2-driver-1.0.0.dev8-1.src.rpm
32
+networking_cumulus/__init__.py
33
+networking_cumulus/_i18n.py
34
+networking_cumulus.egg-info/PKG-INFO
35
+networking_cumulus.egg-info/SOURCES.txt
36
+networking_cumulus.egg-info/dependency_links.txt
37
+networking_cumulus.egg-info/entry_points.txt
38
+networking_cumulus.egg-info/not-zip-safe
39
+networking_cumulus.egg-info/pbr.json
40
+networking_cumulus.egg-info/requires.txt
41
+networking_cumulus.egg-info/top_level.txt
42
+networking_cumulus/db/__init__.py
43
+networking_cumulus/db/migration/__init__.py
44
+networking_cumulus/db/migration/alembic_migrations/__init__.py
45
+networking_cumulus/db/migration/alembic_migrations/env.py
46
+networking_cumulus/db/migration/alembic_migrations/script.py.mako
47
+networking_cumulus/db/migration/alembic_migrations/versions/1134a7f4c7e5_cumulus_init_ops.py
48
+networking_cumulus/db/migration/alembic_migrations/versions/HEAD
49
+networking_cumulus/db/migration/models/__init__.py
50
+networking_cumulus/db/migration/models/head.py
51
+networking_cumulus/mech_driver/__init__.py
52
+networking_cumulus/mech_driver/config.py
53
+networking_cumulus/mech_driver/db.py
54
+networking_cumulus/mech_driver/driver.py
55
+networking_cumulus/mech_driver/hpb_bridge_agent.py
56
+networking_cumulus/mech_driver/models.py
57
+networking_cumulus/tests/__init__.py
58
+networking_cumulus/tests/base.py
59
+networking_cumulus/tests/test_networking_cumulus.py
60
+networking_cumulus/tests/unit/__init__.py
61
+networking_cumulus/tests/unit/ml2/__init__.py
62
+networking_cumulus/tests/unit/ml2/test_cumulus_mech.py
63
+networking_cumulus/utils/__init__.py
64
+networking_cumulus/utils/discovery.py
65
+networking_cumulus/utils/misc.py
66
+releasenotes/notes/.placeholder
67
+releasenotes/source/conf.py
68
+releasenotes/source/index.rst
69
+releasenotes/source/unreleased.rst
70
+releasenotes/source/_static/.placeholder
71
+releasenotes/source/_templates/.placeholder
72
+rpm/SPECS/cumulus.spec

+ 1
- 0
images/rpm/networking_cumulus.egg-info/dependency_links.txt View File

@@ -0,0 +1 @@
1
+

+ 6
- 0
images/rpm/networking_cumulus.egg-info/entry_points.txt View File

@@ -0,0 +1,6 @@
1
+[neutron.db.alembic_migrations]
2
+networking-cumulus = networking_cumulus.db.migration:alembic_migrations
3
+
4
+[neutron.ml2.mechanism_drivers]
5
+cumulus = networking_cumulus.mech_driver.driver:CumulusMechanismDriver
6
+

+ 1
- 0
images/rpm/networking_cumulus.egg-info/not-zip-safe View File

@@ -0,0 +1 @@
1
+

+ 1
- 0
images/rpm/networking_cumulus.egg-info/pbr.json View File

@@ -0,0 +1 @@
1
+{"is_release": false, "git_version": "b6606d3"}

+ 1
- 0
images/rpm/networking_cumulus.egg-info/requires.txt View File

@@ -0,0 +1 @@
1
+pbr>=1.6

+ 1
- 0
images/rpm/networking_cumulus.egg-info/top_level.txt View File

@@ -0,0 +1 @@
1
+networking_cumulus

cumulus_ml2/__init__.py → networking_cumulus/__init__.py View File


+ 42
- 0
networking_cumulus/_i18n.py View File

@@ -0,0 +1,42 @@
1
+# All Rights Reserved.
2
+#
3
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+#    not use this file except in compliance with the License. You may obtain
5
+#    a copy of the License at
6
+#
7
+#         http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+#    Unless required by applicable law or agreed to in writing, software
10
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+#    License for the specific language governing permissions and limitations
13
+#    under the License.
14
+
15
+import oslo_i18n
16
+
17
+DOMAIN = "networking-cumulus"
18
+
19
+_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN)
20
+
21
+# The primary translation function using the well-known name "_"
22
+_ = _translators.primary
23
+
24
+# The contextual translation function using the name "_C"
25
+_C = _translators.contextual_form
26
+
27
+# The plural translation function using the name "_P"
28
+_P = _translators.plural_form
29
+
30
+# Translators for log levels.
31
+#
32
+# The abbreviated names are meant to reflect the usual use of a short
33
+# name like '_'. The "L" is for "log" and the other letter comes from
34
+# the level.
35
+_LI = _translators.log_info
36
+_LW = _translators.log_warning
37
+_LE = _translators.log_error
38
+_LC = _translators.log_critical
39
+
40
+
41
+def get_available_languages():
42
+    return oslo_i18n.get_available_languages(DOMAIN)

cumulus_ml2/mech_driver/__init__.py → networking_cumulus/db/__init__.py View File


cumulus_ml2/utils/__init__.py → networking_cumulus/db/migration/__init__.py View File


+ 0
- 0
networking_cumulus/db/migration/alembic_migrations/__init__.py View File


+ 125
- 0
networking_cumulus/db/migration/alembic_migrations/env.py View File

@@ -0,0 +1,125 @@
1
+# Copyright 2016 Cumulus Networks
2
+#
3
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+#    not use this file except in compliance with the License. You may obtain
5
+#    a copy of the License at
6
+#
7
+#         http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+#    Unless required by applicable law or agreed to in writing, software
10
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+#    License for the specific language governing permissions and limitations
13
+#    under the License.
14
+
15
+from logging import config as logging_config
16
+
17
+from alembic import context
18
+from oslo_config import cfg
19
+from oslo_db.sqlalchemy import session
20
+import sqlalchemy as sa
21
+from sqlalchemy import event
22
+
23
+from neutron.db.migration.alembic_migrations import external
24
+from neutron.db.migration.models import head  # noqa
25
+from neutron.db import model_base
26
+
27
+from networking_cumulus.db.migration.models import head  # noqa
28
+
29
+
30
+MYSQL_ENGINE = None
31
+CUMULUS_VERSION_TABLE = 'cumulus_alembic_version'
32
+
33
+# this is the Alembic Config object, which provides
34
+# access to the values within the .ini file in use.
35
+config = context.config
36
+neutron_config = config.neutron_config
37
+
38
+# Interpret the config file for Python logging.
39
+# This line sets up loggers basically.
40
+logging_config.fileConfig(config.config_file_name)
41
+
42
+# set the target for 'autogenerate' support
43
+target_metadata = model_base.BASEV2.metadata
44
+
45
+
46
+def set_mysql_engine():
47
+    try:
48
+        mysql_engine = neutron_config.command.mysql_engine
49
+    except cfg.NoSuchOptError:
50
+        mysql_engine = None
51
+
52
+    global MYSQL_ENGINE
53
+    MYSQL_ENGINE = (mysql_engine or
54
+                    model_base.BASEV2.__table_args__['mysql_engine'])
55
+
56
+
57
+def include_object(object, name, type_, reflected, compare_to):
58
+    if type_ == 'table' and name in (
59
+            set(external.TABLES) - set(external.REPO_CUMULUS_TABLES)):
60
+        return False
61
+    else:
62
+        return True
63
+
64
+
65
+def run_migrations_offline():
66
+    """Run migrations in 'offline' mode.
67
+
68
+    This configures the context with either a URL
69
+    or an Engine.
70
+
71
+    Calls to context.execute() here emit the given string to the
72
+    script output.
73
+
74
+    """
75
+    set_mysql_engine()
76
+
77
+    kwargs = dict()
78
+    if neutron_config.database.connection:
79
+        kwargs['url'] = neutron_config.database.connection
80
+    else:
81
+        kwargs['dialect_name'] = neutron_config.database.engine
82
+    kwargs['include_object'] = include_object
83
+    kwargs['version_table'] = CUMULUS_VERSION_TABLE
84
+    context.configure(**kwargs)
85
+
86
+    with context.begin_transaction():
87
+        context.run_migrations()
88
+
89
+
90
+@event.listens_for(sa.Table, 'after_parent_attach')
91
+def set_storage_engine(target, parent):
92
+    if MYSQL_ENGINE:
93
+        target.kwargs['mysql_engine'] = MYSQL_ENGINE
94
+
95
+
96
+def run_migrations_online():
97
+    """Run migrations in 'online' mode.
98
+
99
+    In this scenario we need to create an Engine
100
+    and associate a connection with the context.
101
+
102
+    """
103
+    set_mysql_engine()
104
+    engine = session.create_engine(neutron_config.database.connection)
105
+
106
+    connection = engine.connect()
107
+    context.configure(
108
+        connection=connection,
109
+        target_metadata=target_metadata,
110
+        include_object=include_object,
111
+        version_table=CUMULUS_VERSION_TABLE
112
+    )
113
+
114
+    try:
115
+        with context.begin_transaction():
116
+            context.run_migrations()
117
+    finally:
118
+        connection.close()
119
+        engine.dispose()
120
+
121
+
122
+if context.is_offline_mode():
123
+    run_migrations_offline()
124
+else:
125
+    run_migrations_online()

+ 21
- 0
networking_cumulus/db/migration/alembic_migrations/script.py.mako View File

@@ -0,0 +1,21 @@
1
+"""${message}
2
+
3
+Revision ID: ${up_revision}
4
+Revises: ${down_revision | comma,n}
5
+Create Date: ${create_date}
6
+
7
+"""
8
+
9
+# revision identifiers, used by Alembic.
10
+revision = ${repr(up_revision)}
11
+down_revision = ${repr(down_revision)}
12
+branch_labels = ${repr(branch_labels)}
13
+depends_on = ${repr(depends_on)}
14
+
15
+from alembic import op
16
+import sqlalchemy as sa
17
+${imports if imports else ""}
18
+
19
+
20
+def upgrade():
21
+    ${upgrades if upgrades else "pass"}

+ 65
- 0
networking_cumulus/db/migration/alembic_migrations/versions/1134a7f4c7e5_cumulus_init_ops.py View File

@@ -0,0 +1,65 @@
1
+# Copyright 2016 Cumulus Networks
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+
16
+
17
+"""cumulus init ops
18
+
19
+Revision ID: 1134a7f4c7e5
20
+Revises:
21
+Create Date: 2016-11-07 08:19:38.391772
22
+
23
+"""
24
+
25
+# revision identifiers, used by Alembic.
26
+revision = '1134a7f4c7e5'
27
+down_revision = None
28
+branch_labels = None
29
+depends_on = None
30
+
31
+from alembic import op
32
+import sqlalchemy as sa
33
+
34
+
35
+def upgrade():
36
+    # commands auto generated by Alembic - please adjust!
37
+    op.create_table(
38
+        'cumulus_networks',
39
+        sa.Column('tenant_id', sa.String(length=255), nullable=True),
40
+        sa.Column('id', sa.String(length=36), nullable=False),
41
+        sa.Column('network_id', sa.String(length=36), nullable=True),
42
+        sa.Column('segmentation_id', sa.Integer(), nullable=True),
43
+        sa.Column('bridge_name', sa.String(length=15), nullable=True),
44
+        sa.PrimaryKeyConstraint('id'),
45
+    )
46
+    op.create_index(op.f('ix_cumulus_networks_tenant_id'), 'cumulus_networks',
47
+                    ['tenant_id'], unique=False)
48
+
49
+    op.create_table(
50
+        'cumulus_ports',
51
+        sa.Column('tenant_id', sa.String(length=255), nullable=True),
52
+        sa.Column('id', sa.String(length=36), nullable=False),
53
+        sa.Column('network_id', sa.String(length=36), nullable=True),
54
+        sa.Column('port_id', sa.String(length=36), nullable=True),
55
+        sa.Column('device_id', sa.String(length=255), nullable=True),
56
+        sa.Column('bridge_name', sa.String(length=15), nullable=True),
57
+        sa.Column('server_id', sa.String(length=255), nullable=True),
58
+        sa.Column('host_id', sa.String(length=255), nullable=True),
59
+        sa.Column('vni', sa.Integer(), nullable=True),
60
+        sa.PrimaryKeyConstraint('id'),
61
+    )
62
+    op.create_index(op.f('ix_cumulus_ports_tenant_id'), 'cumulus_ports',
63
+                    ['tenant_id'], unique=False)
64
+
65
+    # end Alembic commands

+ 1
- 0
networking_cumulus/db/migration/alembic_migrations/versions/HEAD View File

@@ -0,0 +1 @@
1
+1134a7f4c7e5

+ 0
- 0
networking_cumulus/db/migration/models/__init__.py View File


+ 21
- 0
networking_cumulus/db/migration/models/head.py View File

@@ -0,0 +1,21 @@
1
+# Copyright 2016 Cumulus Networks
2
+#
3
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+#    not use this file except in compliance with the License. You may obtain
5
+#    a copy of the License at
6
+#
7
+#         http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+#    Unless required by applicable law or agreed to in writing, software
10
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+#    License for the specific language governing permissions and limitations
13
+#    under the License.
14
+
15
+from neutron.db.migration.models import head
16
+
17
+from networking_cumulus.mech_driver import models  # noqa
18
+
19
+
20
+def get_metadata():
21
+    return head.model_base.BASEV2.metadata

+ 0
- 0
networking_cumulus/mech_driver/__init__.py View File


+ 45
- 0
networking_cumulus/mech_driver/config.py View File

@@ -0,0 +1,45 @@
1
+# Copyright 2016 Cumulus Networks
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+
16
+from oslo_config import cfg
17
+
18
+from networking_cumulus._i18n import _
19
+
20
+CUMULUS_DRIVER_OPTS = [
21
+    cfg.StrOpt('scheme',
22
+               default='http',
23
+               help=_('Scheme for base URL for the Cumulus ML2 API')),
24
+    cfg.IntOpt('protocol_port',
25
+               default='8000',
26
+               help=_('Protocol port for base URL for the Cumulus ML2 API')),
27
+    cfg.StrOpt('username',
28
+               default='cumulus',
29
+               help=_('username for Cumulus switch')),
30
+    cfg.StrOpt('password',
31
+               default='CumulusLinux!',
32
+               help=_('password for Cumulus switch')),
33
+    cfg.ListOpt('switches', default=[],
34
+                help=_('list of switch name/ip and remote switch port '
35
+                       'connected to this compute node')),
36
+    cfg.IntOpt('sync_time', default=30,
37
+               help=_('Periodic time interval for checking connection with '
38
+                      'switch. (0=no syncing)')),
39
+    cfg.BoolOpt('spf_enable', default=False,
40
+                help=_('SPF configuration for the bridge')),
41
+    cfg.BoolOpt('new_bridge', default=False,
42
+                help=_('Bridge model used for configuration'))
43
+]
44
+
45
+cfg.CONF.register_opts(CUMULUS_DRIVER_OPTS, 'ml2_cumulus')

+ 136
- 0
networking_cumulus/mech_driver/db.py View File

@@ -0,0 +1,136 @@
1
+# Copyright 2016 Cumulus Networks
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+
16
+import neutron.db.api as db_api
17
+
18
+from networking_cumulus.mech_driver import models as db_models
19
+
20
+VLAN_SEGMENTATION = 'vlan'
21
+
22
+
23
+def db_create_network(tenant_id, network_id, vlan_id, bridge_name):
24
+    session = db_api.get_session()
25
+    with session.begin():
26
+        network = (session.query(db_models.CumulusNetworks)
27
+                   .filter_by(network_id=network_id,
28
+                              tenant_id=tenant_id).first())
29
+
30
+        if not network:
31
+            network = db_models.CumulusNetworks(network_id=network_id,
32
+                                                tenant_id=tenant_id,
33
+                                                segmentation_id=vlan_id,
34
+                                                bridge_name=bridge_name)
35
+            session.add(network)
36
+
37
+
38
+def db_delete_network(tenant_id, network_id):
39
+    session = db_api.get_session()
40
+    with session.begin():
41
+        (session.query(db_models.CumulusNetworks)
42
+         .filter_by(network_id=network_id,
43
+                    tenant_id=tenant_id).delete())
44
+
45
+
46
+def db_get_bridge_name(tenant_id, network_id):
47
+    session = db_api.get_session()
48
+    with session.begin():
49
+        network = (session.query(db_models.CumulusNetworks)
50
+                   .filter_by(network_id=network_id,
51
+                              tenant_id=tenant_id).first())
52
+        if network:
53
+            return network.bridge_name
54
+        else:
55
+            return None
56
+
57
+
58
+def db_get_network(tenant_id, network_id):
59
+    session = db_api.get_session()
60
+    with session.begin():
61
+        network = (session.query(db_models.CumulusNetworks)
62
+                   .filter_by(network_id=network_id,
63
+                              tenant_id=tenant_id).first())
64
+        if network:
65
+            return network
66
+        else:
67
+            return None
68
+
69
+
70
+def db_create_port(tenant_id, network_id, port_id, host_id, device_id,
71
+                   bridge_name, server_id, vni):
72
+    session = db_api.get_session()
73
+    with session.begin():
74
+        port = (session.query(db_models.CumulusPorts)
75
+                .filter_by(network_id=network_id,
76
+                           tenant_id=tenant_id,
77
+                           server_id=server_id,
78
+                           host_id=host_id).first())
79
+
80
+        if not port:
81
+            port = db_models.CumulusPorts(port_id=port_id,
82
+                                          tenant_id=tenant_id,
83
+                                          network_id=network_id,
84
+                                          host_id=host_id,
85
+                                          device_id=device_id,
86
+                                          bridge_name=bridge_name,
87
+                                          server_id=server_id,
88
+                                          vni=vni)
89
+            session.add(port)
90
+
91
+
92
+def db_delete_port(network_id, port_id, server_id, host_id):
93
+    session = db_api.get_session()
94
+    with session.begin():
95
+        session.query(db_models.CumulusPorts).filter_by(
96
+            network_id=network_id,
97
+            port_id=port_id,
98
+            server_id=server_id,
99
+            host_id=host_id).delete()
100
+
101
+
102
+def db_update_port(tenant_id, network_id, port_id, host_id, device_id,
103
+                   bridge_name, server_id, vni):
104
+    session = db_api.get_session()
105
+    with session.begin():
106
+        all_ports = (session.query(db_models.CumulusPorts)
107
+                     .filter_by(network_id=network_id,
108
+                                port_id=port_id,
109
+                                server_id=server_id).all())
110
+        for port in all_ports:
111
+            port.host_id = host_id
112
+            port.device_id = device_id
113
+            port.vni = vni
114
+
115
+
116
+def db_get_ports_by_server_id(server_id):
117
+    session = db_api.get_session()
118
+    with session.begin():
119
+        all_ports = (session.query(db_models.CumulusPorts)
120
+                     .filter_by(server_id=server_id).all())
121
+        return all_ports
122
+
123
+
124
+def db_get_port(network_id, port_id, server_id, host_id):
125
+    session = db_api.get_session()
126
+    with session.begin():
127
+        port = session.query(db_models.CumulusPorts).filter_by(
128
+            network_id=network_id,
129
+            port_id=port_id,
130
+            server_id=server_id,
131
+            host_id=host_id).first()
132
+
133
+        if port:
134
+            return port
135
+        else:
136
+            return None

+ 614
- 0
networking_cumulus/mech_driver/driver.py View File

@@ -0,0 +1,614 @@
1
+# Copyright 2016 Cumulus Networks
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+
16
+import json
17
+
18
+import threading
19
+
20
+from enum import Enum
21
+
22
+from oslo_config import cfg
23
+from oslo_log import log as logging
24
+import requests
25
+
26
+from neutron.extensions import portbindings
27
+from neutron.plugins.ml2.common.exceptions import MechanismDriverError
28
+from neutron.plugins.ml2 import driver_api as api
29
+
30
+from networking_cumulus._i18n import _, _LI
31
+from networking_cumulus.mech_driver import config
32
+from networking_cumulus.mech_driver import db
33
+
34
+LOG = logging.getLogger(__name__)
35
+NETWORKS_URL = _('{scheme}://{base}:{port}/ml2/v1/bridge/{bridge}/{vlanid}')
36
+HOSTS_URL = \
37
+    _('{scheme}://{base}:{port}/ml2/v1/bridge/{bridge}/{vlanid}/hosts/{host}')
38
+VXLAN_URL = \
39
+    _('{scheme}://{base}:{port}/ml2/v1/bridge/{bridge}/{vlanid}/vxlan/{vni}')
40
+SWITCH_HASH_ID_URL = _('{scheme}://{base}:{port}/ml2/v1/hash')
41
+
42
+NEW_BRIDGE_NAME = _('bridge')
43
+
44
+OLD_BRIDGE_NAME_PREFIX = _('br')
45
+
46
+
47
+class SwitchState(Enum):
48
+    inactive = 1
49
+    active = 2
50
+
51
+INVALID_HASH_ID = _('invalid')
52
+INVALID_VNI = -1
53
+
54
+"""list of switches is required to be configured. Add this config to the
55
+ml2_conf.ini config switch names or IPs must be separated using comma.
56
+
57
+[ml2_cumulus]
58
+switches="192.168.10.10,192.168.20.20"
59
+"""
60
+
61
+
62
+class CumulusMechanismDriver(api.MechanismDriver):
63
+    """Mechanism driver for Cumulus Linux
64
+
65
+    It manages connectivity between switches and (compute) hosts
66
+    using the Cumulus API
67
+    """
68
+    def __init__(self):
69
+        self.scheme = cfg.CONF.ml2_cumulus.scheme
70
+        self.protocol_port = cfg.CONF.ml2_cumulus.protocol_port
71
+        self.switches = cfg.CONF.ml2_cumulus.switches
72
+        self.sync_timeout = cfg.CONF.ml2_cumulus.sync_time
73
+        self.spf_enable = cfg.CONF.ml2_cumulus.spf_enable
74
+        self.new_bridge = cfg.CONF.ml2_cumulus.new_bridge
75
+        self.username = cfg.CONF.ml2_cumulus.username
76
+        self.password = cfg.CONF.ml2_cumulus.password
77
+        self.switch_info = {}
78
+        self.sync_timer = None
79
+        self.sync_thread_lock = None
80
+        self.sync = None
81
+
82
+    def initialize(self):
83
+
84
+        for switch_id in self.switches:
85
+            self.switch_info[switch_id, 'spf_enable'] = self.spf_enable
86
+            self.switch_info[switch_id, 'new_bridge'] = self.new_bridge
87
+
88
+        self.sync_thread_lock = threading.Lock()
89
+        if self.sync_timeout > 0:
90
+            self.sync = CumulusSwitchSync(self)
91
+            self.sync_timer = None
92
+            self._sync_thread()
93
+
94
+    def _sync_thread(self):
95
+        with self.sync_thread_lock:
96
+            self.sync.check_and_replay()
97
+
98
+        self.sync_timer = threading.Timer(self.sync_timeout,
99
+                                          self._sync_thread)
100
+        self.sync_timer.start()
101
+
102
+    def _get_bridge_name(self, network_id, new_bridge):
103
+        if new_bridge:
104
+            return NEW_BRIDGE_NAME
105
+        else:
106
+            bridge_name = OLD_BRIDGE_NAME_PREFIX + network_id[:12]
107
+            return bridge_name
108
+
109
+    def bind_port(self, context):
110
+        if context.binding_levels:
111
+            return  # we've already got a top binding
112
+
113
+        # assign a dynamic vlan
114
+        next_segment = context.allocate_dynamic_segment(
115
+            {'id': context.network.current, 'network_type': 'vlan'}
116
+        )
117
+
118
+        context.continue_binding(
119
+            context.segments_to_bind[0]['id'],
120
+            [next_segment]
121
+        )
122
+
123
+    def create_network_precommit(self, context):
124
+        network = context.current
125
+        network_id = network['id']
126
+        tenant_id = network['tenant_id']
127
+        segments = context.network_segments
128
+        vlan_id = segments[0]['segmentation_id']
129
+
130
+        with self.sync_thread_lock:
131
+            db.db_create_network(tenant_id,
132
+                                 network_id,
133
+                                 vlan_id,
134
+                                 self._get_bridge_name(network_id,
135
+                                                       self.new_bridge))
136
+
137
+    def create_network_postcommit(self, context):
138
+        network = context.current
139
+        network_id = network['id']
140
+        tenant_id = network['tenant_id']
141
+        segments = context.network_segments
142
+        vlan_id = segments[0]['segmentation_id']
143
+
144
+        with self.sync_thread_lock:
145
+            bridge_name = db.db_get_bridge_name(tenant_id,
146
+                                                network_id)
147
+        if bridge_name:
148
+            for _switch_id in self.switches:
149
+                try:
150
+                    resp = requests.put(
151
+                        NETWORKS_URL.format(
152
+                            scheme=self.scheme,
153
+                            base=_switch_id,
154
+                            port=self.protocol_port,
155
+                            bridge=bridge_name,
156
+                            vlanid=vlan_id
157
+                        ),
158
+                        data=json.dumps(
159
+                            {'spf':
160
+                             self.switch_info[_switch_id, 'spf_enable'],
161
+                             'newbridge':
162
+                             self.switch_info[_switch_id, 'new_bridge']})
163
+                    )
164
+
165
+                    if resp.status_code != requests.codes.ok:
166
+                        raise MechanismDriverError()
167
+
168
+                except requests.exceptions.RequestException as error:
169
+                    msg = (_("Error connecting to switch (%(switch_id)s)."
170
+                             " HTTP Error %(error)s") %
171
+                           {'switch_id': _switch_id,
172
+                            'error': error})
173
+                    LOG.info(msg)
174
+#                        _LI('Error connecting to switch %s. HTTP Error:%r'),
175
+#                        _switch_id,
176
+#                        error
177
+#                    )
178
+
179
+    def delete_network_postcommit(self, context):
180
+        network_id = context.current['id']
181
+        tenant_id = context.current['tenant_id']
182
+        segments = context.network_segments
183
+        vlan_id = segments[0]['segmentation_id']
184
+
185
+        with self.sync_thread_lock:
186
+            bridge_name = db.db_get_bridge_name(tenant_id,
187
+                                                network_id)
188
+
189
+        # remove vxlan from all hosts - a little unpleasant
190
+        for _switch_id in self.switches:
191
+            try:
192
+                resp = requests.delete(
193
+                    NETWORKS_URL.format(
194
+                        scheme=self.scheme,
195
+                        base=_switch_id,
196
+                        port=self.protocol_port,
197
+                        bridge=bridge_name,
198
+                        vlanid=vlan_id
199
+                    )
200
+                )
201
+
202
+                if resp.status_code != requests.codes.ok:
203
+                    LOG.info(
204
+                        _LI('Error during network delete. HTTP Error:%d'),
205
+                        resp.status_code
206
+                    )
207
+
208
+            except requests.exceptions.RequestException as error:
209
+                msg = (_("Error connecting to switch (%(switch_id)s)."
210
+                         " HTTP Error %(error)s") %
211
+                       {'switch_id': _switch_id,
212
+                        'error': error})
213
+                LOG.info(msg)
214
+#                    _LI('Error connecting to switch %s. HTTP Error:%r'),
215
+#                    _switch_id,
216
+#                    error
217
+#                )
218
+
219
+        with self.sync_thread_lock:
220
+            db.db_delete_network(tenant_id, network_id)
221
+
222
+    def create_port_precommit(self, context):
223
+        if not hasattr(context, 'current'):
224
+            return
225
+
226
+        port = context.current
227
+        port_id = port['id']
228
+        device_id = port['device_id']
229
+        network_id = port['network_id']
230
+        tenant_id = port['tenant_id']
231
+        host = port[portbindings.HOST_ID]
232
+
233
+        if hasattr(context, 'top_bound_segment'):
234
+            if context.top_bound_segment:
235
+                vni = context.top_bound_segment['segmentation_id']
236
+            else:
237
+                vni = INVALID_VNI
238
+        else:
239
+            vni = INVALID_VNI
240
+
241
+        with self.sync_thread_lock:
242
+            bridge_name = db.db_get_bridge_name(tenant_id, network_id)
243
+            if not bridge_name:
244
+                return
245
+
246
+            for _switch_id in self.switches:
247
+                db.db_create_port(tenant_id, network_id, port_id, host,
248
+                                  device_id, bridge_name, _switch_id, vni)
249
+
250
+    def create_port_postcommit(self, context):
251
+        if not hasattr(context, 'current'):
252
+            return
253
+
254
+        port = context.current
255
+        network_id = port['network_id']
256
+        tenant_id = port['tenant_id']
257
+
258
+        with self.sync_thread_lock:
259
+            network = db.db_get_network(tenant_id, network_id)
260
+            if not network:
261
+                return
262
+
263
+        if context.segments_to_bind:
264
+            self._add_to_switch(context, network)
265
+
266
+    def update_port_postcommit(self, context):
267
+        if not hasattr(context, 'current'):
268
+            return
269
+
270
+        port = context.current
271
+        port_id = port['id']
272
+        network_id = port['network_id']
273
+        tenant_id = port['tenant_id']
274
+        device_id = port['device_id']
275
+        host = port[portbindings.HOST_ID]
276
+
277
+        if not host:
278
+            return
279
+
280
+        if hasattr(context, 'top_bound_segment'):
281
+            if context.top_bound_segment:
282
+                vni = context.top_bound_segment['segmentation_id']
283
+            else:
284
+                vni = INVALID_VNI
285
+        else:
286
+            vni = INVALID_VNI
287
+
288
+        with self.sync_thread_lock:
289
+            network = db.db_get_network(tenant_id, network_id)
290
+            if not network:
291
+                return
292
+
293
+        if context.host != context.original_host:
294
+            self._remove_from_switch(context.original, network)
295
+        self._add_to_switch(context, network)
296
+
297
+        with self.sync_thread_lock:
298
+            for _switch_id in self.switches:
299
+                db_port = db.db_get_port(network_id, port_id, _switch_id, host)
300
+                if not db_port:
301
+                    db.db_create_port(tenant_id, network_id, port_id,
302
+                                      host, device_id,
303
+                                      network.bridge_name, _switch_id, vni)
304
+                else:
305
+                    db.db_update_port(tenant_id, network_id, port_id,
306
+                                      host, device_id,
307
+                                      network.bridge_name, _switch_id, vni)
308
+
309
+    def delete_port_postcommit(self, context):
310
+        if not hasattr(context, 'current'):
311
+            return
312
+
313
+        port = context.current
314
+        network_id = port['network_id']
315
+        tenant_id = port['tenant_id']
316
+
317
+        with self.sync_thread_lock:
318
+            network = db.db_get_network(tenant_id, network_id)
319
+            if not network:
320
+                return
321
+
322
+        self._remove_from_switch(port, network)
323
+
324
+    def _add_to_switch(self, context, network):
325
+
326
+        port = context.current
327
+        device_id = port['device_id']
328
+        device_owner = port['device_owner']
329
+        host = port[portbindings.HOST_ID]
330
+        if not hasattr(context, 'top_bound_segment'):
331
+            return
332
+        if not context.top_bound_segment:
333
+            return
334
+        vni = context.top_bound_segment['segmentation_id']
335
+        vlan_id = context.bottom_bound_segment['segmentation_id']
336
+
337
+        if not (host and device_id and device_owner):
338
+            return
339
+
340
+        for _switch_id in self.switches:
341
+            actions = [
342
+                HOSTS_URL.format(
343
+                    scheme=self.scheme,
344
+                    base=_switch_id,
345
+                    port=self.protocol_port,
346
+                    bridge=network.bridge_name,
347
+                    vlanid=vlan_id,
348
+                    host=host
349
+                ),
350
+            ]
351
+
352
+            if context.top_bound_segment != context.bottom_bound_segment:
353
+
354
+                actions.append(
355
+                    VXLAN_URL.format(
356
+                        scheme=self.scheme,
357
+                        base=_switch_id,
358
+                        port=self.protocol_port,
359
+                        bridge=network.bridge_name,
360
+                        vlanid=vlan_id,
361
+                        vni=vni
362
+                    )
363
+                )
364
+
365
+            for action in actions:
366
+                try:
367
+                    resp = requests.put(action)
368
+
369
+                    if resp.status_code != requests.codes.ok:
370
+                        msg = (_("Error (%(code)s) update port for %(host)s on"
371
+                                 " switch %(switch_id)s") %
372
+                               {'code': resp.status_code,
373
+                                'host': host,
374
+                                'switch_id': _switch_id})
375
+
376
+                        LOG.info(msg)
377
+#                            _LI('error (%(code)) update port for %(host) on '
378
+#                            'switch: %(switch_id)'),
379
+#                            resp.status_code,
380
+#                            host,
381
+#                            _switch_id
382
+#                        )
383
+                        return resp.status_code
384
+#                    raise MechanismDriverError()
385
+
386
+                except requests.exceptions.RequestException as error:
387
+                    msg = (_("Error connecting to switch (%(switch_id)s)."
388
+                             " HTTP Error %(error)s") %
389
+                           {'switch_id': _switch_id,
390
+                            'error': error})
391
+                    LOG.info(msg)
392
+#                        _LI('Error connecting to switch %s. HTTP Error:%r'),
393
+#                        _switch_id,
394
+#                        error
395
+#                    )
396
+
397
+    def _remove_from_switch(self, port, network):
398
+        host = port[portbindings.HOST_ID]
399
+        port_id = port['id']
400
+
401
+        for _switch_id in self.switches:
402
+            with self.sync_thread_lock:
403
+                db_port = db.db_get_port(network.network_id,
404
+                                         port_id,
405
+                                         _switch_id,
406
+                                         host)
407
+                if not db_port:
408
+                    continue
409
+                vni = db_port.vni
410
+
411
+            actions = [
412
+                HOSTS_URL.format(
413
+                    scheme=self.scheme,
414
+                    base=_switch_id,
415
+                    port=self.protocol_port,
416
+                    bridge=network.bridge_name,
417
+                    vlanid=network.segmentation_id,
418
+                    host=host
419
+                ),
420
+            ]
421
+
422
+            if (vni != INVALID_VNI) and (network.segmentation_id != vni):
423
+                actions.append(
424
+                    VXLAN_URL.format(
425
+                        scheme=self.scheme,
426
+                        base=_switch_id,
427
+                        port=self.protocol_port,
428
+                        bridge=network.bridge_name,
429
+                        vlanid=network.segmentation_id,
430
+                        vni=vni
431
+                    )
432
+                )
433
+
434
+            for action in actions:
435
+                try:
436
+                    resp = requests.delete(action)
437
+
438
+                    if resp.status_code != requests.codes.ok:
439
+                        msg = (_("Error (%(code)s) delete port for %(host)s on"
440
+                                 " switch %(switch_id)s") %
441
+                               {'code': resp.status_code,
442
+                                'host': host,
443
+                                'switch_id': _switch_id})
444
+                        LOG.info(msg)
445
+#                            _LI('error (%d) del port for %s on switch: %s'),
446
+#                            resp.status_code,
447
+#                            host,
448
+#                            _switch_id
449
+#                        )
450
+
451
+                except requests.exceptions.RequestException as error:
452
+                    msg = (_("Error connecting to switch (%(switch_id)s)."
453
+                             " HTTP Error %(error)s") %
454
+                           {'switch_id': _switch_id,
455
+                            'error': error})
456
+                    LOG.info(msg)
457
+#                        _LI('Error connecting to switch %s. HTTP Error:%r'),
458
+#                        _switch_id,
459
+#                        error
460
+#                    )
461
+
462
+            with self.sync_thread_lock:
463
+                db.db_delete_port(network.network_id, port_id, _switch_id,
464
+                                  host)
465
+
466
+    def replay_to_switch(self, switch_id, bridge_name, port, vlan):
467
+
468
+        try:
469
+            resp = requests.put(
470
+                NETWORKS_URL.format(
471
+                    scheme=self.scheme,
472
+                    base=switch_id,
473
+                    port=self.protocol_port,
474
+                    bridge=bridge_name,
475
+                    vlanid=vlan
476
+                ),
477
+                data=json.dumps({'spf':
478
+                                 self.switch_info[switch_id, 'spf_enable'],
479
+                                 'newbridge':
480
+                                 self.switch_info[switch_id, 'new_bridge']})
481
+            )
482
+
483
+            if resp.status_code != requests.codes.ok:
484
+                msg = (_("Error %(code)d replay to switch %(switch_id)s.") %
485
+                       {'code': resp.status_code,
486
+                        'switch_id': switch_id})
487
+                LOG.info(msg)
488
+#                    _LI('Error with request to switch %s. Error:%d'),
489
+#                    switch_id,
490
+#                    resp.status_code
491
+#                )
492
+                return resp.status_code
493
+
494
+        except requests.exceptions.RequestException as error:
495
+            msg = (_("Error connecting to switch %(switch_id)s."
496
+                     " HTTP Error %(error)s") %
497
+                   {'switch_id': switch_id,
498
+                    'error': error})
499
+            LOG.info(msg)
500
+#                _LI('Error connecting to switch %s. HTTP Error:%r'),
501
+#                switch_id,
502
+#                error
503
+#            )
504
+
505
+        actions = [
506
+            HOSTS_URL.format(
507
+                scheme=self.scheme,
508
+                base=switch_id,
509
+                port=self.protocol_port,
510
+                bridge=bridge_name,
511
+                vlanid=vlan,
512
+                host=port.host_id
513
+            ),
514
+        ]
515
+
516
+        if (port.vni != INVALID_VNI) and (port.vni != vlan):
517
+            actions.append(
518
+                VXLAN_URL.format(
519
+                    scheme=self.scheme,
520
+                    base=switch_id,
521
+                    port=self.protocol_port,
522
+                    bridge=bridge_name,
523
+                    vlanid=vlan,
524
+                    vni=port.vni
525
+                )
526
+            )
527
+
528
+        for action in actions:
529
+            try:
530
+                resp = requests.put(action)
531
+
532
+                if resp.status_code != requests.codes.ok:
533
+                    msg = (_("Error %(code)d replay to switch %(switch_id)s") %
534
+                           {'code': resp.status_code,
535
+                            'switch_id': switch_id})
536
+                    LOG.info(msg)
537
+#                        _LI('Error with request to switch %s. Error:%d'),
538
+#                        switch_id,
539
+#                        resp.status_code
540
+#                    )
541
+                    return resp.status_code
542
+
543
+            except requests.exceptions.RequestException as error:
544
+                msg = (_("Error connecting to switch (%(switch_id)s)."
545
+                         " HTTP Error %(error)s") %
546
+                       {'switch_id': switch_id,
547
+                        'error': error})
548
+                LOG.info(msg)
549
+#                    _LI('Error connecting to switch %s. HTTP Error:%r'),
550
+#                    switch_id,
551
+#                    error
552
+#                )
553
+
554
+        return requests.codes.ok
555
+
556
+
557
+class CumulusSwitchSync(object):
558
+    def __init__(self, mech_driver):
559
+        self._mech_driver = mech_driver
560
+        for switch_id in self._mech_driver.switches:
561
+            self._mech_driver.switch_info[switch_id, 'state'] =\
562
+                SwitchState.inactive
563
+            self._mech_driver.switch_info[switch_id, 'hash_id'] =\
564
+                INVALID_HASH_ID
565
+            self._mech_driver.switch_info[switch_id, 'replay'] = True
566
+
567
+    def replay_config(self, switch_id):
568
+        all_ports = db.db_get_ports_by_server_id(switch_id)
569
+        for port in all_ports:
570
+            network = db.db_get_network(port.tenant_id, port.network_id)
571
+            if network:
572
+                status = self._mech_driver.replay_to_switch(
573
+                    switch_id,
574
+                    network.bridge_name,
575
+                    port,
576
+                    network.segmentation_id)
577
+
578
+                if status != requests.codes.ok:
579
+                    self._mech_driver.switch_info[switch_id, 'replay'] = True
580
+
581
+    def check_switch_connections(self):
582
+
583
+        for switch_id in self._mech_driver.switches:
584
+            try:
585
+                resp = requests.get(
586
+                    SWITCH_HASH_ID_URL.format(
587
+                        scheme=self._mech_driver.scheme,
588
+                        base=switch_id,
589
+                        port=self._mech_driver.protocol_port
590
+                    )
591
+                )
592
+
593
+                data = resp.json()
594
+
595
+                if data != self._mech_driver.switch_info[switch_id, 'hash_id']:
596
+                    self._mech_driver.switch_info[switch_id, 'state'] = \
597
+                        SwitchState.active
598
+                    self._mech_driver.switch_info[switch_id, 'replay'] = True
599
+                    self._mech_driver.switch_info[switch_id, 'hash_id'] = data
600
+
601
+            except requests.exceptions.RequestException:
602
+                self._mech_driver.switch_info[switch_id, 'state'] = \
603
+                    SwitchState.inactive
604
+                self._mech_driver.switch_info[switch_id, 'replay'] = False
605
+                self._mech_driver.switch_info[switch_id, 'hash_id'] = \
606
+                    INVALID_HASH_ID
607
+
608
+    def check_and_replay(self):
609
+        self.check_switch_connections()
610
+
611
+        for switch_id in self._mech_driver.switches:
612
+            if self._mech_driver.switch_info[switch_id, 'replay']:
613
+                self._mech_driver.switch_info[switch_id, 'replay'] = False
614
+                self.replay_config(switch_id)

cumulus_ml2/mech_driver/hpb_bridge_agent.py → networking_cumulus/mech_driver/hpb_bridge_agent.py View File

@@ -1,3 +1,18 @@
1
+# Copyright 2016 Cumulus Networks
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+
1 16
 import sys
2 17
 
3 18
 from oslo_config import cfg
@@ -5,13 +20,14 @@ from oslo_log import log as logging
5 20
 
6 21
 from neutron.common import config as common_config
7 22
 from neutron.common import utils as neutron_utils
8
-from neutron.i18n import _LE, _LI, _LW
9 23
 from neutron.plugins.linuxbridge.agent import linuxbridge_neutron_agent as lna
10 24
 
11 25
 from utils.discovery import DiscoveryManager
12 26
 from utils.misc import Shell
13 27
 
14
-DEFAULT_ROOT_HELPER = 'sudo'
28
+from networking_cumulus._i18n import _, _LE, _LI
29
+
30
+DEFAULT_ROOT_HELPER = _('sudo')
15 31
 
16 32
 LOG = logging.getLogger(__name__)
17 33
 
@@ -34,11 +50,14 @@ class HPBLinuxBridgeNeutronAgentRPC(lna.LinuxBridgeNeutronAgentRPC):
34 50
                     neighbor['mgmt-ip']
35 51
                 break
36 52
         else:
37
-            LOG.error(
38
-                _LE('Unable to find %s neighbor for interface %s'),
39
-                physnet,
40
-                interface
41
-            )
53
+            msg = (_("Unable to find %(nbr)s for interface %(intf)s") %
54
+                   {'nbr': physnet,
55
+                    'intf': interface})
56
+            LOG.error(msg)
57
+#                _LE('Unable to find %s neighbor for interface %s'),
58
+#                physnet,
59
+#                interface
60
+#            )
42 61
 
43 62
 
44 63
 def main():
@@ -60,4 +79,3 @@ def main():
60 79
     LOG.info(_LI("Agent initialized successfully, now running... "))
61 80
     agent.daemon_loop()
62 81
     sys.exit(0)
63
-

+ 84
- 0
networking_cumulus/mech_driver/models.py View File

@@ -0,0 +1,84 @@
1
+# Copyright 2016 Cumulus Networks
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+
16
+import sqlalchemy as sa
17
+
18
+from neutron.api.v2 import attributes as attr
19
+from neutron.db import model_base
20
+from neutron.db import models_v2
21
+
22
+BRIDGE_STR_LEN = 15
23
+CUMULUS_UUID_FIELD_SIZE = 36
24
+
25
+
26
+class CumulusNetworks(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):
27
+    """Represents a binding of network id to cumulus bridge."""
28
+
29
+    __tablename__ = "cumulus_networks"
30
+
31
+    network_id = sa.Column(sa.String(CUMULUS_UUID_FIELD_SIZE))
32
+    segmentation_id = sa.Column(sa.Integer)
33
+    bridge_name = sa.Column(sa.String(BRIDGE_STR_LEN))
34
+
35
+    def __init__(self, network_id=None, tenant_id=None, segmentation_id=None,
36
+                 bridge_name=None, **kwargs):
37
+        super(CumulusNetworks, self).__init__(**kwargs)
38
+#        self.id = network_id
39
+        self.network_id = network_id
40
+        self.tenant_id = tenant_id
41
+        self.bridge_name = bridge_name
42
+        self.segmentation_id = segmentation_id
43
+
44
+    def network_representation(self):
45
+        return {u'networkId': self.network_id,
46
+                u'tenantId': self.tenant_id,
47
+                u'segmentationId': self.segmentation_id,
48
+                u'bridgeName': self.bridge_name}
49
+
50
+
51
+class CumulusPorts(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):
52
+
53
+    __tablename__ = "cumulus_ports"
54
+
55
+    network_id = sa.Column(sa.String(CUMULUS_UUID_FIELD_SIZE))
56
+    port_id = sa.Column(sa.String(CUMULUS_UUID_FIELD_SIZE))
57
+    device_id = sa.Column(sa.String(attr.NAME_MAX_LEN))
58
+    bridge_name = sa.Column(sa.String(BRIDGE_STR_LEN))
59
+    server_id = sa.Column(sa.String(attr.NAME_MAX_LEN))
60
+    host_id = sa.Column(sa.String(attr.NAME_MAX_LEN))
61
+    vni = sa.Column(sa.Integer)
62
+
63
+    def __init__(self, port_id=None, tenant_id=None, network_id=None,
64
+                 device_id=None, server_id=None, bridge_name=None,
65
+                 host_id=None, vni=None, **kwargs):
66
+        super(CumulusPorts, self).__init__(**kwargs)
67
+        self.port_id = port_id
68
+        self.tenant_id = tenant_id
69
+        self.network_id = network_id
70
+        self.device_id = device_id
71
+        self.server_id = server_id
72
+        self.bridge_name = bridge_name
73
+        self.host_id = host_id
74
+        self.vni = vni
75
+
76
+    def port_representation(self):
77
+        return {u'networkId': self.network_id,
78
+                u'tenantId': self.tenant_id,
79
+                u'portId': self.port_id,
80
+                u'deviceId': self.device_id,
81
+                u'bridgeName': self.bridge_name,
82
+                u'host': self.host_id,
83
+                u'serverId': self.server_id,
84
+                u'vni': self.vni}

+ 0
- 0
networking_cumulus/tests/__init__.py View File


+ 23
- 0
networking_cumulus/tests/base.py View File

@@ -0,0 +1,23 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+# Copyright 2010-2011 OpenStack Foundation
4
+# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
5
+#
6
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
7
+# not use this file except in compliance with the License. You may obtain
8
+# a copy of the License at
9
+#
10
+#      http://www.apache.org/licenses/LICENSE-2.0
11
+#
12
+# Unless required by applicable law or agreed to in writing, software
13
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+# License for the specific language governing permissions and limitations
16
+# under the License.
17
+
18
+from oslotest import base
19
+
20
+
21
+class TestCase(base.BaseTestCase):
22
+
23
+    """Test case base class for all unit tests."""

+ 28
- 0
networking_cumulus/tests/test_networking_cumulus.py View File

@@ -0,0 +1,28 @@
1
+# -*- coding: utf-8 -*-
2
+
3
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+# not use this file except in compliance with the License. You may obtain
5
+# a copy of the License at
6
+#
7
+#      http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+# Unless required by applicable law or agreed to in writing, software
10
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+# License for the specific language governing permissions and limitations
13
+# under the License.
14
+
15
+"""
16
+test_networking_cumulus
17
+----------------------------------
18
+
19
+Tests for `networking_cumulus` module.
20
+"""
21
+
22
+from networking_cumulus.tests import base
23
+
24
+
25
+class TestNetworking_cumulus(base.TestCase):
26
+
27
+    def test_something(self):
28
+        pass

+ 0
- 0
networking_cumulus/tests/unit/__init__.py View File


+ 0
- 0
networking_cumulus/tests/unit/ml2/__init__.py View File


+ 1143
- 0
networking_cumulus/tests/unit/ml2/test_cumulus_mech.py
File diff suppressed because it is too large
View File


+ 0
- 0
networking_cumulus/utils/__init__.py View File


cumulus_ml2/utils/discovery.py → networking_cumulus/utils/discovery.py View File

@@ -1,6 +1,23 @@
1
+# Copyright 2016 Cumulus Networks
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+
16
+
1 17
 class DiscoveryError(RuntimeError):
2 18
     pass
3 19
 
20
+
4 21
 class DiscoveryManager(object):
5 22
     def __init__(self, shell):
6 23
         self.shell = shell
@@ -14,9 +31,11 @@ class DiscoveryManager(object):
14 31
         # This causes a problem where neutron asks for serverX port
15 32
         # but it doesn't exist. If in a multi-VM bringup, causes neutron
16 33
         # to go nuts so for now just don't do it. If user actually forgot
17
-        # to enable LLDP on server port. Then, too bad. it never gets provisioned
18
-        # Better way to handle this problem will be investigated. For now, always
19
-        # remember to configure LLDP correctly. Suggest even have PTM running
34
+        # to enable LLDP on server port. Then, too bad.
35
+        # It never gets provisioned
36
+        # Better way to handle this problem will be investigated.
37
+        # For now, always remember to configure LLDP correctly.
38
+        # Suggest even have PTM running
20 39
         # to ensure LLDP is configured correctly
21 40
         # raise DiscoveryError('Could not find host: {}'.format(hostname))
22 41
 
@@ -29,15 +48,18 @@ class DiscoveryManager(object):
29 48
             pass
30 49
 
31 50
     def fetch_neighbors(self):
32
-        output = self.shell.call(['lldpcli', 'show', 'neighbors', '-f', 'keyvalue'])
51
+        output = self.shell.call(['lldpcli', 'show', 'neighbors', '-f',
52
+                                  'keyvalue'])
33 53
         parsed = parse_lldpd_output(output)
34 54
 
35 55
         return parsed['lldp']
36 56
 
57
+
37 58
 def parse_lldpd_output(output):
59
+    """http://stackoverflow.com/questions/20577303/parse-lldp-output-with-python
60
+
38 61
     """
39
-    http://stackoverflow.com/questions/20577303/parse-lldp-output-with-python
40
-    """
62
+
41 63
     result = {}
42 64
     entries = output.strip().split('\n')
43 65
 

+ 30
- 0
networking_cumulus/utils/misc.py View File

@@ -0,0 +1,30 @@
1
+# Copyright 2016 Cumulus Networks
2
+# All Rights Reserved.
3
+#
4
+#    Licensed under the Apache License, Version 2.0 (the "License"); you may
5
+#    not use this file except in compliance with the License. You may obtain
6
+#    a copy of the License at
7
+#
8
+#         http://www.apache.org/licenses/LICENSE-2.0
9
+#
10
+#    Unless required by applicable law or agreed to in writing, software
11
+#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
+#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
+#    License for the specific language governing permissions and limitations
14
+#    under the License.
15
+
16
+from subprocess import check_output
17
+import yaml
18
+
19
+
20
+def load_config(path):
21
+    with open(path) as fp:
22
+        return yaml.load(fp)
23
+
24
+
25
+class Shell(object):
26
+    def __init__(self, root_helper):
27
+        self.root_helper = root_helper
28
+
29
+    def call(self, args):
30
+        return check_output([self.root_helper] + args)

+ 0
- 0
releasenotes/notes/.placeholder View File


+ 0
- 0
releasenotes/source/_static/.placeholder View File


+ 0
- 0
releasenotes/source/_templates/.placeholder View File


+ 275
- 0
releasenotes/source/conf.py View File

@@ -0,0 +1,275 @@
1
+# -*- coding: utf-8 -*-
2
+# Licensed under the Apache License, Version 2.0 (the "License");
3
+# you may not use this file except in compliance with the License.
4
+# You may obtain a copy of the License at
5
+#
6
+#    http://www.apache.org/licenses/LICENSE-2.0
7
+#
8
+# Unless required by applicable law or agreed to in writing, software
9
+# distributed under the License is distributed on an "AS IS" BASIS,
10
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11
+# implied.
12
+# See the License for the specific language governing permissions and
13
+# limitations under the License.
14
+
15
+# Glance Release Notes documentation build configuration file, created by
16
+# sphinx-quickstart on Tue Nov  3 17:40:50 2015.
17
+#
18
+# This file is execfile()d with the current directory set to its
19
+# containing dir.
20
+#
21
+# Note that not all possible configuration values are present in this
22
+# autogenerated file.
23
+#
24
+# All configuration values have a default; values that are commented out
25
+# serve to show the default.
26
+
27
+# If extensions (or modules to document with autodoc) are in another directory,
28
+# add these directories to sys.path here. If the directory is relative to the
29
+# documentation root, use os.path.abspath to make it absolute, like shown here.
30
+# sys.path.insert(0, os.path.abspath('.'))
31
+
32
+# -- General configuration ------------------------------------------------
33
+
34
+# If your documentation needs a minimal Sphinx version, state it here.
35
+# needs_sphinx = '1.0'
36
+
37
+# Add any Sphinx extension module names here, as strings. They can be
38
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39
+# ones.
40
+extensions = [
41
+    'oslosphinx',
42
+    'reno.sphinxext',
43
+]
44
+
45
+# Add any paths that contain templates here, relative to this directory.
46
+templates_path = ['_templates']
47
+
48
+# The suffix of source filenames.
49
+source_suffix = '.rst'
50
+
51
+# The encoding of source files.
52
+# source_encoding = 'utf-8-sig'
53
+
54
+# The master toctree document.
55
+master_doc = 'index'
56
+
57
+# General information about the project.
58
+project = u'networking-cumulus Release Notes'
59
+copyright = u'2016, OpenStack Foundation'
60
+
61
+# The version info for the project you're documenting, acts as replacement for
62
+# |version| and |release|, also used in various other places throughout the
63
+# built documents.
64
+#
65
+# The short X.Y version.
66
+# The full version, including alpha/beta/rc tags.
67
+release = ''
68
+# The short X.Y version.
69
+version = ''
70
+
71
+# The language for content autogenerated by Sphinx. Refer to documentation
72
+# for a list of supported languages.
73
+# language = None
74
+
75
+# There are two options for replacing |today|: either, you set today to some
76
+# non-false value, then it is used:
77
+# today = ''
78
+# Else, today_fmt is used as the format for a strftime call.
79
+# today_fmt = '%B %d, %Y'
80
+
81
+# List of patterns, relative to source directory, that match files and
82
+# directories to ignore when looking for source files.
83
+exclude_patterns = []
84
+
85
+# The reST default role (used for this markup: `text`) to use for all
86
+# documents.
87
+# default_role = None
88
+
89
+# If true, '()' will be appended to :func: etc. cross-reference text.
90
+# add_function_parentheses = True
91
+
92
+# If true, the current module name will be prepended to all description
93
+# unit titles (such as .. function::).
94
+# add_module_names = True
95
+
96
+# If true, sectionauthor and moduleauthor directives will be shown in the
97
+# output. They are ignored by default.
98
+# show_authors = False
99
+
100
+# The name of the Pygments (syntax highlighting) style to use.
101
+pygments_style = 'sphinx'
102
+
103
+# A list of ignored prefixes for module index sorting.
104
+# modindex_common_prefix = []
105
+
106
+# If true, keep warnings as "system message" paragraphs in the built documents.
107
+# keep_warnings = False
108
+
109
+
110
+# -- Options for HTML output ----------------------------------------------
111
+
112
+# The theme to use for HTML and HTML Help pages.  See the documentation for
113
+# a list of builtin themes.
114
+html_theme = 'default'
115
+
116
+# Theme options are theme-specific and customize the look and feel of a theme
117
+# further.  For a list of options available for each theme, see the
118
+# documentation.
119
+# html_theme_options = {}
120
+
121
+# Add any paths that contain custom themes here, relative to this directory.
122
+# html_theme_path = []
123
+
124
+# The name for this set of Sphinx documents.  If None, it defaults to
125
+# "<project> v<release> documentation".
126
+# html_title = None
127
+
128
+# A shorter title for the navigation bar.  Default is the same as html_title.
129
+# html_short_title = None
130
+
131
+# The name of an image file (relative to this directory) to place at the top
132
+# of the sidebar.
133
+# html_logo = None
134
+
135
+# The name of an image file (within the static path) to use as favicon of the
136
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
137
+# pixels large.
138
+# html_favicon = None
139
+
140
+# Add any paths that contain custom static files (such as style sheets) here,
141
+# relative to this directory. They are copied after the builtin static files,
142
+# so a file named "default.css" will overwrite the builtin "default.css".
143
+html_static_path = ['_static']
144
+
145
+# Add any extra paths that contain custom files (such as robots.txt or
146
+# .htaccess) here, relative to this directory. These files are copied
147
+# directly to the root of the documentation.
148
+# html_extra_path = []
149
+
150
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
151
+# using the given strftime format.
152
+# html_last_updated_fmt = '%b %d, %Y'
153
+
154
+# If true, SmartyPants will be used to convert quotes and dashes to
155
+# typographically correct entities.
156
+# html_use_smartypants = True
157
+
158
+# Custom sidebar templates, maps document names to template names.
159
+# html_sidebars = {}
160
+
161
+# Additional templates that should be rendered to pages, maps page names to
162
+# template names.
163
+# html_additional_pages = {}
164
+
165
+# If false, no module index is generated.
166
+# html_domain_indices = True
167
+
168
+# If false, no index is generated.
169
+# html_use_index = True
170
+
171
+# If true, the index is split into individual pages for each letter.
172
+# html_split_index = False
173
+
174
+# If true, links to the reST sources are added to the pages.
175
+# html_show_sourcelink = True
176
+
177
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
178
+# html_show_sphinx = True
179
+
180
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
181
+# html_show_copyright = True
182
+
183
+# If true, an OpenSearch description file will be output, and all pages will
184
+# contain a <link> tag referring to it.  The value of this option must be the
185
+# base URL from which the finished HTML is served.
186
+# html_use_opensearch = ''
187
+
188
+# This is the file name suffix for HTML files (e.g. ".xhtml").
189
+# html_file_suffix = None
190
+
191
+# Output file base name for HTML help builder.
192
+htmlhelp_basename = 'GlanceReleaseNotesdoc'
193
+
194
+
195
+# -- Options for LaTeX output ---------------------------------------------
196
+
197
+latex_elements = {
198
+    # The paper size ('letterpaper' or 'a4paper').
199
+    # 'papersize': 'letterpaper',
200
+
201
+    # The font size ('10pt', '11pt' or '12pt').
202
+    # 'pointsize': '10pt',
203
+
204
+    # Additional stuff for the LaTeX preamble.
205
+    # 'preamble': '',
206
+}
207
+
208
+# Grouping the document tree into LaTeX files. List of tuples
209
+# (source start file, target name, title,
210
+#  author, documentclass [howto, manual, or own class]).
211
+latex_documents = [
212
+    ('index', 'GlanceReleaseNotes.tex', u'Glance Release Notes Documentation',
213
+     u'Glance Developers', 'manual'),
214
+]
215
+
216
+# The name of an image file (relative to this directory) to place at the top of
217
+# the title page.
218
+# latex_logo = None
219
+
220
+# For "manual" documents, if this is true, then toplevel headings are parts,
221
+# not chapters.
222
+# latex_use_parts = False
223
+
224
+# If true, show page references after internal links.
225
+# latex_show_pagerefs = False
226
+
227
+# If true, show URL addresses after external links.
228
+# latex_show_urls = False
229
+
230
+# Documents to append as an appendix to all manuals.
231
+# latex_appendices = []
232
+
233
+# If false, no module index is generated.
234
+# latex_domain_indices = True
235
+
236
+
237
+# -- Options for manual page output ---------------------------------------
238
+
239
+# One entry per manual page. List of tuples
240
+# (source start file, name, description, authors, manual section).
241
+man_pages = [
242
+    ('index', 'glancereleasenotes', u'Glance Release Notes Documentation',
243
+     [u'Glance Developers'], 1)
244
+]
245
+
246
+# If true, show URL addresses after external links.
247
+# man_show_urls = False
248
+
249
+
250
+# -- Options for Texinfo output -------------------------------------------
251
+
252
+# Grouping the document tree into Texinfo files. List of tuples
253
+# (source start file, target name, title, author,
254
+#  dir menu entry, description, category)
255
+texinfo_documents = [
256
+    ('index', 'GlanceReleaseNotes', u'Glance Release Notes Documentation',
257
+     u'Glance Developers', 'GlanceReleaseNotes',
258
+     'One line description of project.',
259
+     'Miscellaneous'),
260
+]
261
+
262
+# Documents to append as an appendix to all manuals.
263
+# texinfo_appendices = []
264
+
265
+# If false, no module index is generated.
266
+# texinfo_domain_indices = True
267
+
268
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
269
+# texinfo_show_urls = 'footnote'
270
+
271
+# If true, do not generate a @detailmenu in the "Top" node's menu.
272
+# texinfo_no_detailmenu = False
273
+
274
+# -- Options for Internationalization output ------------------------------
275
+locale_dirs = ['locale/']

+ 8
- 0
releasenotes/source/index.rst View File

@@ -0,0 +1,8 @@
1
+============================================
2
+ networking-cumulus Release Notes
3
+============================================
4
+
5
+.. toctree::
6
+   :maxdepth: 1
<