diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 02bd630..0000000 --- a/.coveragerc +++ /dev/null @@ -1,8 +0,0 @@ -[run] -branch = True -source = networking_cisco -omit = networking_cisco/tests/*,networking_cisco/openstack/* -concurrency = greenlet - -[report] -ignore_errors = True diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 71c1d37..0000000 --- a/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -AUTHORS -build/* -build-stamp -ChangeLog -cover/ -covhtml/ -dist/ -doc/build -*.DS_Store -*.pyc -*.egg-info/ -neutron/vcsversion.py -neutron/versioninfo -pbr*.egg/ -quantum.egg-info/ -quantum/vcsversion.py -quantum/versioninfo -src/ -setuptools*.egg/ -*.log -*.mo -*.sw? -*~ -/.* -!/.coveragerc -!/.gitignore -!/.gitreview -!/.mailmap -!/.pylintrc -!/.testr.conf -*.tar.gz -releasenotes/build diff --git a/.gitreview b/.gitreview deleted file mode 100644 index e15929a..0000000 --- a/.gitreview +++ /dev/null @@ -1,4 +0,0 @@ -[gerrit] -host=review.openstack.org -port=29418 -project=openstack/networking-cisco.git diff --git a/.mailmap b/.mailmap deleted file mode 100644 index 516ae6f..0000000 --- a/.mailmap +++ /dev/null @@ -1,3 +0,0 @@ -# Format is: -# -# diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index cb448fb..0000000 --- a/.pylintrc +++ /dev/null @@ -1,117 +0,0 @@ -# The format of this file isn't really documented; just use --generate-rcfile -[MASTER] -# Add to the black list. It should be a base name, not a -# path. You may set this option multiple times. -# -# Note the 'openstack' below is intended to match only -# neutron.openstack.common. If we ever have another 'openstack' -# dirname, then we'll need to expand the ignore features in pylint :/ -ignore=.git,tests,openstack - -[MESSAGES CONTROL] -# NOTE(gus): This is a long list. A number of these are important and -# should be re-enabled once the offending code is fixed (or marked -# with a local disable) -disable= -# "F" Fatal errors that prevent further processing - import-error, -# "I" Informational noise - locally-disabled, -# "E" Error for important programming issues (likely bugs) - access-member-before-definition, - no-member, - no-method-argument, - no-self-argument, -# "W" Warnings for stylistic problems or minor programming issues - abstract-method, - arguments-differ, - attribute-defined-outside-init, - bad-builtin, - bad-indentation, - broad-except, - dangerous-default-value, - deprecated-lambda, - duplicate-key, - expression-not-assigned, - fixme, - global-statement, - global-variable-not-assigned, - no-init, - non-parent-init-called, - protected-access, - redefined-builtin, - redefined-outer-name, - signature-differs, - star-args, - super-init-not-called, - unpacking-non-sequence, - unused-argument, - unused-import, - unused-variable, -# "C" Coding convention violations - bad-continuation, - invalid-name, - missing-docstring, - old-style-class, - superfluous-parens, -# "R" Refactor recommendations - abstract-class-little-used, - abstract-class-not-used, - duplicate-code, - interface-not-implemented, - no-self-use, - too-few-public-methods, - too-many-ancestors, - too-many-arguments, - too-many-branches, - too-many-instance-attributes, - too-many-lines, - too-many-locals, - too-many-public-methods, - too-many-return-statements, - too-many-statements - -[BASIC] -# Variable names can be 1 to 31 characters long, with lowercase and underscores -variable-rgx=[a-z_][a-z0-9_]{0,30}$ - -# Argument names can be 2 to 31 characters long, with lowercase and underscores -argument-rgx=[a-z_][a-z0-9_]{1,30}$ - -# Method names should be at least 3 characters long -# and be lowecased with underscores -method-rgx=([a-z_][a-z0-9_]{2,}|setUp|tearDown)$ - -# Module names matching neutron-* are ok (files in bin/) -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+)|(neutron-[a-z0-9_-]+))$ - -# Don't require docstrings on tests. -no-docstring-rgx=((__.*__)|([tT]est.*)|setUp|tearDown)$ - -[FORMAT] -# Maximum number of characters on a single line. -max-line-length=79 - -[VARIABLES] -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -# _ is used by our localization -additional-builtins=_ - -[CLASSES] -# List of interface methods to ignore, separated by a comma. -ignore-iface-methods= - -[IMPORTS] -# Deprecated modules which should not be used, separated by a comma -deprecated-modules= -# should use openstack.common.jsonutils - json - -[TYPECHECK] -# List of module names for which member attributes should not be checked -ignored-modules=six.moves,_MovedItems - -[REPORTS] -# Tells whether to display a full report or only the messages -reports=no diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index fb306a1..0000000 --- a/.testr.conf +++ /dev/null @@ -1,6 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_LOG_CAPTURE=1 \ - ${PYTHON:-python} -m subunit.run discover -t ./ \ - ${OS_TEST_PATH:-./networking_cisco/tests/unit} $LISTOPT $IDOPTION | cat -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst deleted file mode 100644 index 2b322ba..0000000 --- a/CONTRIBUTING.rst +++ /dev/null @@ -1,25 +0,0 @@ -If you would like to contribute to the development of OpenStack, -you must follow the steps in this page: - - http://docs.openstack.org/infra/manual/developers.html - -Once those steps have been completed, changes to OpenStack -should be submitted for review via the Gerrit tool, following -the workflow documented at: - - http://docs.openstack.org/infra/manual/developers.html#development-workflow - -Pull requests submitted through GitHub will be ignored. - -Bugs should be filed on Launchpad, not GitHub: - - https://bugs.launchpad.net/networking-cisco - -Tox environments provided in networking-cisco: - -* py27, py34 - Unit tests run against Mitaka neutron, on different python2.7 and python3.4 -* newton - Unit tests run against Newton neutron with python2.7 -* master - Unit tests run against master neutron with python2.7 -* coverage - provides a report on the test coverage -* compare-coverage - compares coverage reports from before and after the current changes -* pep8 - Checks code against the pep8 and OpenStack hacking rules diff --git a/HACKING.rst b/HACKING.rst deleted file mode 100644 index 217ddc7..0000000 --- a/HACKING.rst +++ /dev/null @@ -1,32 +0,0 @@ -Neutron Style Commandments -======================= - -- Step 1: Read the OpenStack Style Commandments - http://docs.openstack.org/developer/hacking/ -- Step 2: Read on - -Neutron Specific Commandments --------------------------- - -- [N319] Validate that debug level logs are not translated -- [N320] Validate that LOG messages, except debug ones, have translations -- [N321] Validate that jsonutils module is used instead of json -- [N322] Detect common errors with assert_called_once_with -- [N323] Enforce namespace-less imports for oslo libraries - -Creating Unit Tests -------------------- -For every new feature, unit tests should be created that both test and -(implicitly) document the usage of said feature. If submitting a patch for a -bug that had no unit test, a new passing unit test should be added. If a -submitted bug fix does have a unit test, be sure to add a new one that fails -without the patch and passes with the patch. - -All unittest classes must ultimately inherit from testtools.TestCase. In the -Neutron test suite, this should be done by inheriting from -neutron.tests.base.BaseTestCase. - -All setUp and tearDown methods must upcall using the super() method. -tearDown methods should be avoided and addCleanup calls should be preferred. -Never manually create tempfiles. Always use the tempfile fixtures from -the fixture library to ensure that they are cleaned up. diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 68c771a..0000000 --- a/LICENSE +++ /dev/null @@ -1,176 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 4e527c7..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,14 +0,0 @@ -include AUTHORS -include README.rst -include ChangeLog -include LICENSE -include neutron/db/migration/README -include neutron/db/migration/alembic.ini -include neutron/db/migration/alembic_migrations/script.py.mako -include neutron/db/migration/alembic_migrations/versions/README -recursive-include neutron/locale * - -exclude .gitignore -exclude .gitreview - -global-exclude *.pyc diff --git a/README b/README new file mode 100644 index 0000000..8fcd2b2 --- /dev/null +++ b/README @@ -0,0 +1,14 @@ +This project is no longer maintained. + +The contents of this repository are still available in the Git +source code management system. To see the contents of this +repository before it reached its end of life, please check out the +previous commit with "git checkout HEAD^1". + +For ongoing work on maintaining OpenStack packages in the Debian +distribution, please see the Debian OpenStack packaging team at +https://wiki.debian.org/OpenStack/. + +For any further questions, please email +openstack-dev@lists.openstack.org or join #openstack-dev on +Freenode. diff --git a/README.rst b/README.rst deleted file mode 100644 index 1b81411..0000000 --- a/README.rst +++ /dev/null @@ -1,25 +0,0 @@ -================ -networking-cisco -================ - -The networking-cisco project's goal is to provide support for Cisco networking -hardware and software in OpenStack deployments. This includes ML2 drivers and -agents for neutron, as well as other pieces of software which interact with -neutron to best utilise your Cisco products with OpenStack. - -* Free software: Apache license -* Documentation: http://docwiki.cisco.com/wiki/OpenStack -* Source: http://git.openstack.org/cgit/openstack/networking-cisco -* Bugs: http://bugs.launchpad.net/networking-cisco - -Releases and Version Support ----------------------------- - -From Mitaka forward, networking-cisco is branchless and releases will be made -from master. We have a goal to maintain compatibility with multiple versions of -OpenStack for as long as possible starting from version 4.0.0 which is -compatible with both Mitaka and Newton OpenStack releases. - -* 4.X.X Mitaka and Newton onwards -* 3.X.X Mitaka -* 2.X.X Liberty diff --git a/TESTING.rst b/TESTING.rst deleted file mode 100644 index d3b7795..0000000 --- a/TESTING.rst +++ /dev/null @@ -1,219 +0,0 @@ -Testing Neutron -============================================================= - -Overview --------- - -The unit tests (neutron/test/unit/) are meant to cover as much code as -possible and should be executed without the service running. They are -designed to test the various pieces of the neutron tree to make sure -any new changes don't break existing functionality. - -The functional tests (neutron/tests/functional/) are intended to -validate actual system interaction. Mocks should be used sparingly, -if at all. Care should be taken to ensure that existing system -resources are not modified and that resources created in tests are -properly cleaned up. - -Development process -------------------- - -It is expected that any new changes that are proposed for merge -come with tests for that feature or code area. Ideally any bugs -fixes that are submitted also have tests to prove that they stay -fixed! In addition, before proposing for merge, all of the -current tests should be passing. - -Virtual environments -~~~~~~~~~~~~~~~~~~~~ - -Testing OpenStack projects, including Neutron, is made easier with `DevStack `_. - -Create a machine (such as a VM or Vagrant box) running a distribution supported -by DevStack and install DevStack there. For example, there is a Vagrant script -for DevStack at https://github.com/bcwaldon/vagrant_devstack. - - .. note:: - - If you prefer not to use DevStack, you can still check out source code on your local - machine and develop from there. - - -Running unit tests ------------------- - -There are three mechanisms for running tests: run_tests.sh, tox, -and nose2. Before submitting a patch for review you should always -ensure all test pass; a tox run is triggered by the jenkins gate -executed on gerrit for each patch pushed for review. - -With these mechanisms you can either run the tests in the standard -environment or create a virtual environment to run them in. - -By default after running all of the tests, any pep8 errors -found in the tree will be reported. - - -With `run_tests.sh` -~~~~~~~~~~~~~~~~~~~ - -You can use the `run_tests.sh` script in the root source directory to execute -tests in a virtualenv:: - - ./run_tests -V - - -With `nose2` -~~~~~~~~~~~ - -You can use `nose2`_ to run individual tests, as well as use for debugging -portions of your code:: - - source .venv/bin/activate - pip install nose2 - nose2 - -There are disadvantages to running nose2 - the tests are run sequentially, so -race condition bugs will not be triggered, and the full test suite will -take significantly longer than tox & testr. The upside is that testr has -some rough edges when it comes to diagnosing errors and failures, and there is -no easy way to set a breakpoint in the Neutron code, and enter an -interactive debugging session while using testr. - -It is also possible to use nose2's predecessor, `nose`_, to run the tests:: - - source .venv/bin/activate - pip install nose - nosetests - -nose has one additional disadvantage over nose2 - it does not -understand the `load_tests protocol`_ introduced in Python 2.7. This -limitation will result in errors being reported for modules that -depend on load_tests (usually due to use of `testscenarios`_). - -.. _nose2: http://nose2.readthedocs.org/en/latest/index.html -.. _nose: https://nose.readthedocs.org/en/latest/index.html -.. _load_tests protocol: https://docs.python.org/2/library/unittest.html#load-tests-protocol -.. _testscenarios: https://pypi.python.org/pypi/testscenarios/ - -With `tox` -~~~~~~~~~~ - -Neutron, like other OpenStack projects, uses `tox`_ for managing the virtual -environments for running test cases. It uses `Testr`_ for managing the running -of the test cases. - -Tox handles the creation of a series of `virtualenvs`_ that target specific -versions of Python (2.6, 2.7, 3.3, etc). - -Testr handles the parallel execution of series of test cases as well as -the tracking of long-running tests and other things. - -Running unit tests is as easy as executing this in the root directory of the -Neutron source code:: - - tox - -To run functional tests that do not require sudo privileges or -specific-system dependencies:: - - tox -e functional - -To run all the functional tests in an environment that has been configured -by devstack to support sudo and system-specific dependencies:: - - tox -e dsvm-functional - -For more information on the standard Tox-based test infrastructure used by -OpenStack and how to do some common test/debugging procedures with Testr, -see this wiki page: - - https://wiki.openstack.org/wiki/Testr - -.. _Testr: https://wiki.openstack.org/wiki/Testr -.. _tox: http://tox.readthedocs.org/en/latest/ -.. _virtualenvs: https://pypi.python.org/pypi/virtualenv - - -Running individual tests -~~~~~~~~~~~~~~~~~~~~~~~~ - -For running individual test modules or cases, you just need to pass -the dot-separated path to the module you want as an argument to it. - -For executing a specific test case, specify the name of the test case -class separating it from the module path with a colon. - -For example, the following would run only the JSONV2TestCase tests from -neutron/tests/unit/test_api_v2.py:: - - $ ./run_tests.sh neutron.tests.unit.test_api_v2.JSONV2TestCase - -or:: - - $ tox -e py27 neutron.tests.unit.test_api_v2.JSONV2TestCase - -Adding more tests -~~~~~~~~~~~~~~~~~ - -Neutron has a fast growing code base and there is plenty of areas that -need to be covered by unit and functional tests. - -To get a grasp of the areas where tests are needed, you can check -current coverage by running:: - - $ ./run_tests.sh -c - -Debugging ---------- - -By default, calls to pdb.set_trace() will be ignored when tests -are run. For pdb statements to work, invoke run_tests as follows:: - - $ ./run_tests.sh -d [test module path] - -It's possible to debug tests in a tox environment:: - - $ tox -e venv -- python -m testtools.run [test module path] - -Tox-created virtual environments (venv's) can also be activated -after a tox run and reused for debugging:: - - $ tox -e venv - $ . .tox/venv/bin/activate - $ python -m testtools.run [test module path] - -Tox packages and installs the neutron source tree in a given venv -on every invocation, but if modifications need to be made between -invocation (e.g. adding more pdb statements), it is recommended -that the source tree be installed in the venv in editable mode:: - - # run this only after activating the venv - $ pip install --editable . - -Editable mode ensures that changes made to the source tree are -automatically reflected in the venv, and that such changes are not -overwritten during the next tox run. - -Post-mortem debugging -~~~~~~~~~~~~~~~~~~~~~ - -Setting OS_POST_MORTEM_DEBUGGER in the shell environment will ensure -that the debugger .post_mortem() method will be invoked on test failure:: - - $ OS_POST_MORTEM_DEBUGGER=pdb ./run_tests.sh -d [test module path] - -Supported debuggers are pdb, and pudb. Pudb is full-screen, console-based -visual debugger for Python which let you inspect variables, the stack, -and breakpoints in a very visual way, keeping a high degree of compatibility -with pdb:: - - $ ./.venv/bin/pip install pudb - - $ OS_POST_MORTEM_DEBUGGER=pudb ./run_tests.sh -d [test module path] - -References -========== - -.. [#pudb] PUDB debugger: - https://pypi.python.org/pypi/pudb diff --git a/babel.cfg b/babel.cfg deleted file mode 100644 index 15cd6cb..0000000 --- a/babel.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[python: **.py] - diff --git a/devstack/README.rst b/devstack/README.rst deleted file mode 100755 index f10041f..0000000 --- a/devstack/README.rst +++ /dev/null @@ -1,15 +0,0 @@ -====================== - Enabling in Devstack -====================== - -1. Download DevStack - -2. Add this repo as an external repository:: - - > cat local.conf - [[local|localrc]] - enable_plugin networking-cisco https://git.openstack.org/openstack/networking-cisco.git - enable_service net-cisco - - -3. run ``stack.sh`` diff --git a/devstack/csr1kv/README.TXT b/devstack/csr1kv/README.TXT deleted file mode 100644 index 3cc4757..0000000 --- a/devstack/csr1kv/README.TXT +++ /dev/null @@ -1,19 +0,0 @@ -====================== - Enable CSR1kv script for CSR1kv plugins in Devstack -====================== - -1. Download DevStack - -2. To enable CSR1kv Routing-aaS, in file localrc or local.conf in the root -DevStack directory, add networking-cisco repo as an external repository and -enable q-ciscorouter and ciscocfgagent. - -Refer to following examples for the settings: -local.conf.csr1kv_and_n1kv -localrc.csr1kv_and_n1kv - -3. To enable CSR1kv FWaaS, in file localrc or local.conf in the root DevStack -directory, include the following line: -enable_service cisco-fwaas - -4. run "stack.sh" diff --git a/devstack/csr1kv/cisco b/devstack/csr1kv/cisco deleted file mode 100644 index 65da80b..0000000 --- a/devstack/csr1kv/cisco +++ /dev/null @@ -1,827 +0,0 @@ -# Neutron Cisco plugin -# --------------------------- - -# Save trace setting -CISCO_XTRACE=$(set +o | grep xtrace) -set +o xtrace - -# Name of cisco router plugin -Q_CISCO_ROUTER_PLUGIN=${Q_CISCO_ROUTER_PLUGIN:-} - -# Indicate if a VSM instance should be created -Q_CISCO_PLUGIN_DEVSTACK_VSM=${Q_CISCO_PLUGIN_DEVSTACK_VSM:-True} - -# Specify the VSM image file -Q_CISCO_PLUGIN_VSM_ISO_IMAGE=${Q_CISCO_PLUGIN_VSM_ISO_IMAGE:-} - -# Scecify the VSM parameters -Q_CISCO_PLUGIN_VSM_IP=${Q_CISCO_PLUGIN_VSM_IP:-192.168.168.2} - -# Specify the VSM username -Q_CISCO_PLUGIN_VSM_USERNAME=${Q_CISCO_PLUGIN_VSM_USERNAME:-admin} - -# Specify the VSM passward for above username -Q_CISCO_PLUGIN_VSM_PASSWORD=${Q_CISCO_PLUGIN_VSM_PASSWORD:-Sfish123} - -# Specify the uVEM image/module -Q_CISCO_PLUGIN_UVEM_DEB_IMAGE=${Q_CISCO_PLUGIN_UVEM_DEB_IMAGE:-} - -# Specify the uVEM integration bridge name -Q_CISCO_PLUGIN_INTEGRATION_BRIDGE=${Q_CISCO_PLUGIN_INTEGRATION_BRIDGE:-br-int} - -# Specify the host management interface required by uVEM -Q_CISCO_PLUGIN_HOST_MGMT_INTF=${Q_CISCO_PLUGIN_HOST_MGMT_INTF:-eth0} - -# Specify the upstream (public) interface required by uVEM -Q_CISCO_PLUGIN_UPSTREAM_INTF=${Q_CISCO_PLUGIN_UPSTREAM_INTF:-} - -# Specify if tunneling is enabled -Q_CISCO_PLUGIN_ENABLE_TUNNELING=${Q_CISCO_PLUGIN_ENABLE_TUNNELING:-True} - -# Specify the VXLAN range -Q_CISCO_PLUGIN_VXLAN_ID_RANGES=${Q_CISCO_PLUGIN_VXLAN_ID_RANGES:-5000:10000} - -# Specify the VLAN range -Q_CISCO_PLUGIN_VLAN_RANGES=${Q_CISCO_PLUGIN_VLAN_RANGES:-vlan:1:4094} - -# Specify if VSM should be restarted -Q_CISCO_PLUGIN_RESTART_VSM=${Q_CISCO_PLUGIN_RESTART_VSM:-no} - -# Specify ncclient package information -NCCLIENT_DIR=$DEST/ncclient -NCCLIENT_VERSION=${NCCLIENT_VERSION:-0.3.1} -NCCLIENT_BRANCH=${NCCLIENT_BRANCH:-master} - -# This routine put a prefix on an existing function name -function _prefix_function { - declare -F $1 > /dev/null || die "$1 doesn't exist" - eval "$(echo "${2}_${1}()"; declare -f ${1} | tail -n +2)" -} - -function _has_cisco_router_plugin { - if [[ "$Q_CISCO_ROUTER_PLUGIN" != "" ]]; then - return 0 - fi - return 1 -} -# Prefix openvswitch plugin routines with "ovs" in order to differentiate from -# cisco plugin routines. This means, ovs plugin routines will coexist with cisco -# plugin routines in this script. -source $TOP_DIR/lib/neutron_plugins/openvswitch -#_prefix_function net_neutron_plugin_configure_plugin_agent ovs -#_prefix_function net_neutron_plugin_configure_service ovs - -# Check the version of the installed ncclient package -function check_ncclient_version { -python << EOF -version = '$NCCLIENT_VERSION' -import sys -try: - import pkg_resources - import ncclient - module_version = pkg_resources.get_distribution('ncclient').version - if version != module_version: - sys.exit(1) -except: - sys.exit(1) -EOF -} - -# Install the ncclient package -function install_ncclient { - sudo -E pip install ncclient -} - -# Check if the required version of ncclient has been installed -function is_ncclient_installed { - # Check if the Cisco ncclient repository exists - if [[ ! -d $NCCLIENT_DIR ]]; then - return 1 - fi - # Check if the ncclient is installed with the right version - if ! check_ncclient_version; then - return 1 - fi - - return 0 -} - -function _configure_cisco_router_plugin { - # Install a known compatible ncclient from the Cisco repository if necessary - if ! is_ncclient_installed; then - install_ncclient - fi -} - -# Return the current VSM state -function _get_vsm_state { - sudo virsh list --all | awk '(NR > 2) {if ($2 == "DEVSTACK_VSM") {$1="";$2="";print;}}' -} - -# This routine keeps contacting the VSM in 10s interval until it responds -function _wait_for_vsm_to_comeup { - echo "Wait for the VSM to come up; This may take a while" - sh -c "while ! http_proxy= curl -s -m 5 http://$2:$3@$1; do sleep 10; done" &> /dev/null -} - -# Check if the VSM console is on -function _is_vsm_console_on { - local vnc_no=$(sudo virsh vncdisplay DEVSTACK_VSM 2> /dev/null) - local running=$(ps --no-headers -o cmd -C krdc | sed -n 's/krdc localhost\(:\d*\)/\1/p' | awk -v vno=$vnc_no '$1 == vno {print}') - if [[ -n $running ]]; then - return 0 - else - return 1 - fi -} - -# Open the VSM console -function _open_vsm_console { - vnc_no=$(sudo virsh vncdisplay DEVSTACK_VSM) - krdc localhost$vnc_no& - # remove the process from the current job so that it's not killed at the - # completion of stack.sh - disown %% -} - -# Close the VSM console -function _close_vsm_console { - local vnc_no=$(sudo virsh vncdisplay DEVSTACK_VSM 2> /dev/null) - local console_pid=$(ps --no-headers -o pid,cmd -C krdc | sed -n 's/\(\d*\) krdc localhost\(:\d*\)/\1 \2/p' | awk -v vno=$vnc_no '$2 == vno {print $1}') - if [[ -n $console_pid ]]; then - kill $console_pid - fi -} - -function _repackage_iso_with_ovfenv { - local vsm_tap_ip=$1 - local vsm_ip=$2 - local vsm_iso_image=$3 - local ovf_env_file=$DATA_DIR/neutron/cisco/ovf-env.xml - - if [[ -f $ovf_env_file ]]; then - rm $ovf_env_file - fi - cat > $ovf_env_file <<-EOF - - - - KVM - en - - - - - - - - - - - - - \n' - \n' -EOF - local mntdir=$(mktemp -d) - local ddir=$(mktemp -d) - sudo /bin/mount -o loop -t iso9660 $Q_CISCO_PLUGIN_VSM_ISO_IMAGE $mntdir - cp -r $mntdir/* $ddir - sudo /bin/umount $mntdir - cp $ovf_env_file $ddir - if [[ -f $ddir/isolinux/isolinux.bin ]]; then - (cd $ddir; sudo /usr/bin/mkisofs -uid 0 -gid 0 -J -R -A Cisco_Nexus_1000V_VSM -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -o $vsm_iso_image .) - else - (cd $ddir; sudo /usr/bin/mkisofs -uid 0 -gid 0 -J -R -A Cisco_Nexus_1000V_VSM -b boot/grub/iso9660_stage1_5 -no-emul-boot -boot-load-size 4 -boot-info-table -o $vsm_iso_image .) - fi -} - -function _get_vsm_net { - first=$(echo $Q_CISCO_PLUGIN_VSM_IP | sed -n 's/^\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.[0-9]\{1,3\}$/\1/p') - second=$(echo $Q_CISCO_PLUGIN_VSM_IP | sed -n 's/^\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.[0-9]\{1,3\}$/\2/p') - third=$(echo $Q_CISCO_PLUGIN_VSM_IP | sed -n 's/^\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.\([0-9]\{1,3\}\)\.[0-9]\{1,3\}$/\3/p') - if [[ -z $first || -z $second || -z $third ]]; then - die $LINENO "Incorrect network address: $Q_CISCO_PLUGIN_VSM_IP" - fi - - declare -i f=$first - declare -i s=$second - declare -i t=$third - if (( $f > 255 || $s > 255 || $t > 255 )); then - die $LINENO "Incorrect network address: $Q_CISCO_PLUGIN_VSM_IP" - fi - echo $first.$second.$third -} - -# This routine retrieves the domain id and the primary mac address from the VSM -function _get_vsm_info { - # Node: no code with output should be added here. The caller depends on the - # output from the below expect output - vsm_ip_addr=$1 user=$2 passwd=$3 expect -c ' - spawn /usr/bin/telnet $env(vsm_ip_addr) - set timeout 240 - expect { - -re "Trying.*Connected.*Escape.*Nexus .*login: " { - send "$env(user)\n" - exp_continue - #look for the password prompt - } - - "*?assword:*" { - send "$env(passwd)\n" - } - } - expect { - -re ".*# " { - send "show interface control 0\n" - expect -indices -re ".*# " - puts [string range $expect_out(buffer) \ - 0 [expr $expect_out(0,start) - 1]] - send "show svs domain\n" - expect -indices -re ".*# " - puts [string range $expect_out(buffer) \ - 0 [expr $expect_out(0,start) - 1]] - } - }' | sed -n -e 's/ Hardware: Ethernet, address: \(..\)\(..\)\.\(..\)\(..\)\.\(..\)\(..\).*/\1:\2:\3:\4:\5:\6/p' -e 's/ Domain id: *\(\d*\)/\1/p' - # Node: no code with output should be added here. The caller depends on the - # output from the above expect output -} - -function _configure_vsm { - install_package expect - vsm_ip_addr=$1 user=$2 passwd=$3 expect -c ' - spawn /usr/bin/telnet $env(vsm_ip_addr) - expect { - -re "Trying.*Connected.*Escape.*Nexus .*login: " { - send "$env(user)\n" - exp_continue - #look for the password prompt - } - - "*?assword:*" { - send "$env(passwd)\n" - } - } - expect -re ".*# " - - send "config te\n" - expect -re ".*# " - - send "feature http-server\n" - expect -re ".*# " - - send "feature network-segmentation-manager\n" - expect -re ".*# " - - send "feature segmentation\n" - expect -re ".*# " - - send "port-profile test-profile\n" - expect -re ".*# " - - send "no shut\n" - expect -re ".*# " - - send "state enabled\n" - expect -re ".*# " - - send "publish port-profile\n" - expect -re ".*# " - - send "exit\n" - expect -re ".*# " - - send "port-profile dhcp_pp\n" - expect -re ".*# " - - send "no shut\n" - expect -re ".*# " - - send "state enabled\n" - expect -re ".*# " - - send "publish port-profile\n" - expect -re ".*# " - - send "end\n" - expect -re ".*# " - - send "exit\n" - ' -} - -function send_vsm_arp { - set +o xtrace - sudo sysctl -w net.ipv4.ip_nonlocal_bind=1 - while true; do - sudo arping -U -A -c 3 -q -I $Q_CISCO_PLUGIN_HOST_MGMT_INTF $Q_CISCO_PLUGIN_VSM_IP - sleep 5 - done -} - -# This routine creates a virtual machine that runs VSM -function _create_devstack_vsm { - local vsm_image_file=$DATA_DIR/neutron/cisco/DEVSTACK_VSM.img - local vsm_iso_image - local vsm_xml_file=$DATA_DIR/neutron/cisco/DEVSTACK_VSM.xml - local vsm_arp_proc=$DATA_DIR/neutron/cisco/vsm_arp_proc - local vsm_ip - local vsm_tap_ip - local vsm_net - local vsm_state - local recreate=no - local config_vsm=False - - # Intall krdc package. krdc is used to connect to the VSM desktop/console - install_package krdc - - # Ignore all errors for this function (as latest DevStack will abort on any error) - set +o errexit - - if [[ -z "$Q_CISCO_PLUGIN_VSM_ISO_IMAGE" ]]; then - die $LINENO "Please specify your VSM iso image in the localrc/local.conf file!" - fi - if [[ ! -f "$Q_CISCO_PLUGIN_VSM_ISO_IMAGE" ]]; then - die $LINENO "Can't find the VSM iso image file $Q_CISCO_PLUGIN_VSM_ISO_IMAGE!" - fi - - vsm_iso_image=$DATA_DIR/neutron/cisco/$(basename $Q_CISCO_PLUGIN_VSM_ISO_IMAGE) - - if [[ ! -d $DATA_DIR/neutron/cisco ]]; then - mkdir -p $DATA_DIR/neutron/cisco - fi - - vsm_net=$(_get_vsm_net) - declare -i vsm_ip=${Q_CISCO_PLUGIN_VSM_IP/#$vsm_net./} - local vsm_tap_ip - if [[ $vsm_ip != 1 ]]; then - vsm_tap_ip=${vsm_net}.1 - else - vsm_tap_ip=${vsm_net}.2 - fi - - vsm_state=$(_get_vsm_state) - - # Check if the vsm image is changed - if [[ -f $vsm_xml_file ]]; then - matched=$(grep -c -m 1 "" $vsm_xml_file) - # The image file is changed; the VM needs to be recreated - if [[ "$matched" == "0" ]]; then - recreate=yes - fi - else - recreate=yes - fi - - # In case of restart or recreate, kill the console and destroy the VM - if [[ ( "$vsm_state" == " running" && "$Q_CISCO_PLUGIN_RESTART_VSM" == "yes" ) || "$recreate" == "yes" ]]; then - _close_vsm_console - sudo virsh destroy DEVSTACK_VSM - if [[ "$recreate" == "yes" ]]; then - sudo virsh undefine DEVSTACK_VSM - rm -f $vsm_iso_image - rm -f $vsm_image_file - fi - fi - - vsm_state=$(_get_vsm_state) - - # VSM doesn't exist; create one - if [[ -z $vsm_state ]]; then - local vsm_uuid=$(uuidgen -t) - local libvirt_type=$LIBVIRT_TYPE - - config_vsm=True - # Prepare for the iso image with ovf-env.xml inserted - if [[ ! -f $vsm_iso_image ]]; then - _repackage_iso_with_ovfenv $vsm_tap_ip $Q_CISCO_PLUGIN_VSM_IP $vsm_iso_image - fi - - # Create the VSM disk image file - if [[ ! -f $vsm_image_file ]]; then - sudo qemu-img create $vsm_image_file 8G - fi - - # Determine the libvirt type - if [[ "$libvirt_type" == "kvm" ]]; then - sudo modprobe kvm || true - if [ ! -e /dev/kvm ]; then - echo "WARNING: Switching to QEMU for VSM" - libvirt_type=qemu - fi - fi - - # Note, mac addresses for NICs are hard-coded. VSM seems to take MAC - # addresses in certain ranges. Therefore, random-generated MAC addresses - # may not work. -cat > $vsm_xml_file <<-EOF - - DEVSTACK_VSM - $vsm_uuid - 2048000 - 1024000 - 1 - - hvm - - - - - - - - destroy - destroy - destroy - - - /usr/bin/qemu-system-x86_64 - - - - - -
- - - - - - - -
- - - - -
- - - - -
- - - - - - - -
- - - - - - - -
- - - - - - - -
- - - - - - - - - - - - - -