././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6226528 networking-baremetal-5.2.0.dev5/0000775000175000017500000000000014221364417015573 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/.stestr.conf0000664000175000017500000000010114154223530020027 0ustar00coreycorey[DEFAULT] test_path=./networking_baremetal/tests/unit top_dir=./ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748814.0 networking-baremetal-5.2.0.dev5/AUTHORS0000664000175000017500000000245614221364416016651 0ustar00coreycorey98k <18552437190@163.com> Andreas Jaeger Boden R Charles Short Dmitry Tantsur Dmitry Tantsur Dongcan Ye Doug Hellmann Ghanshyam Mann Harald Jensas Harald Jensås Hervé Beraud Ian Wienand Iury Gregory Melo Ferreira Iury Gregory Melo Ferreira Julia Kreger Kaifeng Wang Le Hou Mark Goddard OpenStack Release Bot Pavlo Shchelokovskyy Riccardo Pittau Sam Betts Sean McGinnis Tuan Do Anh Vasyl Saienko Vieri <15050873171@163.com> Vladyslav Drok Vu Cong Tuan YuehuiLei huang.zhiping inspurericzhang melissaml pengyuesheng wangfaxin zhulingjie ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/CONTRIBUTING.rst0000664000175000017500000000123114154223530020224 0ustar00coreycoreyIf 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 If you already have a good understanding of how the system works and your OpenStack accounts are set up, you can skip to the development workflow section of this documentation to learn how changes to OpenStack should be submitted for review via the Gerrit tool: http://docs.openstack.org/infra/manual/developers.html#development-workflow Pull requests submitted through GitHub will be ignored. Bugs should be filed in StoryBoard, not GitHub: https://storyboard.openstack.org/#!/project/955 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748814.0 networking-baremetal-5.2.0.dev5/ChangeLog0000664000175000017500000001175714221364416017357 0ustar00coreycoreyCHANGES ======= * Set agent\_type in tests * Add Python3 zed unit tests * Update master for stable/yoga 5.1.0 ----- * Re-add python 3.6/3.7 in classifier * Updating yoga tested python versions in classifier * Add Python3 yoga unit tests * Update master for stable/xena 5.0.0 ----- * Add lower-constraints job to current development branch * Increase version of hacking and pycodestyle * Update min version of tox to use allowlist * setup.cfg: Replace dashes with underscores * Add Python3 xena unit tests * Update master for stable/wallaby 4.0.0 ----- * Update minversion of tox * Add doc/requirements * Fix exception handling when querying ironic ports * Remove lower-constraints job * Fix lower-constraints with the new pip resolver * Set safe version of hacking * Add Python3 wallaby unit tests * Update master for stable/victoria 3.0.0 ----- * Fix lower-constraints for networking-baremetal * Add missing keystoneauth1 and oslo.service to requirements * Set min version of tox to 3.2.1 * drop mock from lower-constraints * Use openstacksdk for ironic connection * Remove the unused coding style modules * Switch to newer openstackdocstheme and reno versions * Convert networking-baremetal job to dib * Bump hacking version to 3.0.0 and fix pep8 test * Update lower-constraints.txt * Add unit tests for \_get\_notification\_transport\_url() * Add py38 package metadata * Add Python3 victoria unit tests * Update master for stable/ussuri * Upgrade flake8-import-order version to 0.17.1 2.0.0 ----- * Stop configuring install\_command in tox * Remove the unused oslo.i18n bits * BUILD\_TIMEOUT is not needed * Use mock from unittest * Cleanup py27 support * Explicitly set ramdisk type * Enforce running tox with correct python version based on env * Stop using six library * Fix region option name in documentation * Drop python 2.7 support and testing * Add genconfig env to tox * fixed review link * Drop py2 job * Switch jobs to python3 * Switch to Ussuri jobs * Update neutron requirement * Add versions to release notes series * Update the constraints url * Fix unit tests with ironicclient >=3.0.0 * Update master for stable/train 1.4.0 ----- * Build pdf doc * Blacklist sphinx 2.1.0 (autodoc bug) * Fix networking-baremetal CI * Fix unit tests for networking-baremetal * Bump the openstackdocstheme extension to 1.20 * Update api-ref location * Update networking-baremetal installation * Update Python 3 test runtimes for Train * Update sphinx requirements * Use opendev repository * OpenDev Migration Patch * Replace openstack.org git:// URLs with https:// * Update master for stable/stein 1.3.0 ----- * Supporting all py3 environments with tox * Zuulv3 - Use ironic-base job * Rename agent queue - fixes broken minor update * Clean up oslo.messaging listener properly * Ensure notifications are consumed from non-pool queue * Set amqp\_auto\_delete=true for notifications transport * Docs: Devstack quickstart guides - change drivers * Break out ironic client from neutron agent * Change networking-baremetal to zuulv3/python3 * Correcting a typo in plugin.sh * Change openstack-dev to openstack-discuss * Restrict bashate to devstack/lib instead of lib * Change openstack-dev to openstack-discuss * Don't quote {posargs} in tox.ini * add python 3.6 unit test job * import zuul job settings from project-config * Changing CI job templates for python3-first * Update reno for stable/rocky 1.2.0 ----- * Remove testrepository and .testr.conf * Update neutron-lib requirement for rocky * Add release notes link in README * Updating required neutron version * Switch to using stestr * fix tox python3 overrides * Remove the duplicated "the" 1.1.0 ----- * fix tox python3 overrides * add lower-constraints job * Do not run functional (API) tests in the CI * ML2 Agent: Handle SIGHUP mutable config options * Change Launchpad references to Storyboard * Updated from global requirements * Avoid tox\_install.sh * use common agent topics from neutron-lib * Update reno for stable/queens 1.0.0 ----- * Add unit tests for member manager * Make the agent distributed using hashring and notifications * Fix devstack example * Node state configuration - add log\_agent\_heartbeat * Fix nits in networking-baremetal docs * Add dsvm job * Update docs and generate config file example * Add support to bind type vlan networks * Devstack - Add ironic-neutron-agent * Use reporting\_interval option from neutron * Switch from MechanismDriver to SimpleAgentMechanismDriverBase * Updated from global requirements * start\_flag = True, only first time, or conf change * Add baremetal neutron agent * Updated from global requirements * Updated from global requirements * Updated from global requirements * Use constants from neutron-lib * Update URLs in documents according to document migration * Fix to use "." to source script files * Update reno for stable/pike 0.1.0 ----- * Add initial release note * Add installation documentation * Add devstack plugin to install networking\_baremetal * Add baremetal ML2 driver * Add .gitignore * Initial commit from cookiecutter * Added .gitreview ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/HACKING.rst0000664000175000017500000000025214154223530017363 0ustar00coreycoreynetworking-baremetal Style Commandments =============================================== Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/LICENSE0000664000175000017500000002363714154223530016606 0ustar00coreycorey 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. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/MANIFEST.in0000664000175000017500000000013614154223530017324 0ustar00coreycoreyinclude AUTHORS include ChangeLog exclude .gitignore exclude .gitreview global-exclude *.pyc ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6226528 networking-baremetal-5.2.0.dev5/PKG-INFO0000664000175000017500000000317714221364417016700 0ustar00coreycoreyMetadata-Version: 2.1 Name: networking-baremetal Version: 5.2.0.dev5 Summary: Neutron plugin that provides deep Ironic/Neutron integration. Home-page: https://docs.openstack.org/networking-baremetal/latest/ Author: OpenStack Author-email: openstack-discuss@lists.openstack.org License: UNKNOWN Platform: UNKNOWN Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Requires-Python: >=3.6 License-File: LICENSE License-File: AUTHORS networking-baremetal plugin --------------------------- This project's goal is to provide deep integration between the Networking service and the Bare Metal service and advanced networking features like notifications of port status changes and routed networks support in clouds with Bare Metal service. * Free software: Apache license * Documentation: http://docs.openstack.org/networking-baremetal/latest * Source: http://opendev.org/openstack/networking-baremetal * Bugs: https://storyboard.openstack.org/#!/project/955 * Release notes: https://docs.openstack.org/releasenotes/networking-baremetal/ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/README.rst0000664000175000017500000000113314154223530017253 0ustar00coreycoreynetworking-baremetal plugin --------------------------- This project's goal is to provide deep integration between the Networking service and the Bare Metal service and advanced networking features like notifications of port status changes and routed networks support in clouds with Bare Metal service. * Free software: Apache license * Documentation: http://docs.openstack.org/networking-baremetal/latest * Source: http://opendev.org/openstack/networking-baremetal * Bugs: https://storyboard.openstack.org/#!/project/955 * Release notes: https://docs.openstack.org/releasenotes/networking-baremetal/ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/babel.cfg0000664000175000017500000000002114154223530017305 0ustar00coreycorey[python: **.py] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6026525 networking-baremetal-5.2.0.dev5/devstack/0000775000175000017500000000000014221364417017377 5ustar00coreycorey././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6026525 networking-baremetal-5.2.0.dev5/devstack/lib/0000775000175000017500000000000014221364417020145 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/devstack/lib/networking-baremetal0000664000175000017500000000332714154223530024211 0ustar00coreycorey#!/bin/bash # # lib/networking-baremetal # # Functions to control the configuration and operation of the **Networking Baremetal** # Dependencies: # (none) # Save trace setting _XTRACE_NETWORKING_BAREMETAL=$(set +o | grep xtrace) set +o xtrace # Defaults # -------- # networking-baremetal service NETWORKING_BAREMETAL_REPO=${NETWORKING_BAREMETAL_REPO:-${GIT_BASE}/openstack/networking-baremetal.git} NETWORKING_BAREMETAL_BRANCH=${NETWORKING_BAREMETAL_BRANCH:-master} NETWORKING_BAREMETAL_DIR=${NETWORKING_BAREMETAL_DIR:-$DEST/networking-baremetal} NETWORKING_BAREMETAL_DATA_DIR=""$DATA_DIR/networking-baremetal"" # Support entry points installation of console scripts NETWORKING_BAREMETAL_BIN_DIR=$(get_python_exec_prefix) # Functions # --------- function install_networking_baremetal { setup_develop $NETWORKING_BAREMETAL_DIR } function configure_networking_baremetal { if [[ -z "$Q_ML2_PLUGIN_MECHANISM_DRIVERS" ]]; then Q_ML2_PLUGIN_MECHANISM_DRIVERS='baremetal' else if [[ ! $Q_ML2_PLUGIN_MECHANISM_DRIVERS =~ $(echo '\') ]]; then Q_ML2_PLUGIN_MECHANISM_DRIVERS+=',baremetal' fi fi populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2 mechanism_drivers=$Q_ML2_PLUGIN_MECHANISM_DRIVERS } function configure_networking_baremetal_neutron_agent { configure_keystone_authtoken_middleware $NEUTRON_CONF ironic ironic configure_placement_nova_compute $NEUTRON_CONF } function start_networking_baremetal_neutron_agent { run_process ir-neutronagt "$NETWORKING_BAREMETAL_BIN_DIR/ironic-neutron-agent" } function stop_networking_baremetal_neutron_agent { stop_process ir-neutronagt } function cleanup_networking_baremetal { rm -rf $NETWORKING_BAREMETAL_DATA_DIR } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/devstack/plugin.sh0000664000175000017500000000240414154223530021224 0ustar00coreycorey#!/usr/bin/env bash # plugin.sh - DevStack plugin.sh dispatch script template echo_summary "networking-baremetal devstack plugin.sh called: $1/$2" source $DEST/networking-baremetal/devstack/lib/networking-baremetal enable_python3_package neworking-baremetal # check for service enabled if is_service_enabled networking_baremetal; then if [[ "$1" == "stack" && "$2" == "install" ]]; then # Perform installation of service source echo_summary "Installing Networking Baremetal ML2" install_networking_baremetal elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then # Configure after the other layer 1 and 2 services have been configured echo_summary "Configuring Networking Baremetal Ml2" configure_networking_baremetal echo_summary "Configuring Networking Baremetal Neutron Agent" configure_networking_baremetal_neutron_agent echo_summary "Starting Networking Baremetal Neutron Agent" start_networking_baremetal_neutron_agent fi if [[ "$1" == "unstack" ]]; then echo_summary "Cleaning Networking Baremetal Ml2" cleanup_networking_baremetal echo_summary "Cleaning Networking Baremtal Neutron Agent" stop_networking_baremetal_neutron_agent fi fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/devstack/settings0000664000175000017500000000033314154223530021154 0ustar00coreycorey# settings file for networking_baremetal define_plugin networking-baremetal plugin_requires networking-baremetal ironic plugin_requires networking-baremetal networking-generic-switch enable_service networking_baremetal ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6026525 networking-baremetal-5.2.0.dev5/doc/0000775000175000017500000000000014221364417016340 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/doc/requirements.txt0000664000175000017500000000017714154223530021624 0ustar00coreycoreyreno>=3.1.0 # Apache-2.0 sphinx>=2.0.0,!=2.1.0 # BSD sphinxcontrib-apidoc>=0.2.0 # BSD openstackdocstheme>=2.2.1 # Apache-2.0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6066525 networking-baremetal-5.2.0.dev5/doc/source/0000775000175000017500000000000014221364417017640 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/doc/source/conf.py0000775000175000017500000000724314154223530021143 0ustar00coreycorey# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import logging import os import sys # NOTE(amotoki): In case of oslo_config.sphinxext is enabled, # when resolving automodule neutron.tests.functional.db.test_migrations, # sphinx accesses tests/functional/__init__.py is processed, # eventlet.monkey_patch() is called and monkey_patch() tries to access # pyroute2.common.__class__ attribute. It raises pyroute2 warning and # it causes sphinx build failure due to warning-is-error = 1. # To pass sphinx build, ignore pyroute2 warning explicitly. logging.getLogger('pyroute2').setLevel(logging.ERROR) sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [ 'sphinxcontrib.apidoc', 'oslo_config.sphinxext', 'oslo_config.sphinxconfiggen', 'openstackdocstheme', ] # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. # execute "export SPHINX_DEBUG=1" in your terminal to disable # The suffix of source filenames. source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. copyright = u'2017, The Networking Baremetal team' config_generator_config_file = '../../tools/config/networking-baremetal-config-generator.conf' sample_config_basename = '_static/ironic_neutron_agent.ini' # A list of ignored prefixes for module index sorting. modindex_common_prefix = ['networking_baremetal.'] # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). add_module_names = True # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'native' # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True # -- Options for HTML output -------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. html_theme = 'openstackdocs' # openstackdocstheme options openstackdocs_repo_name = 'openstack/networking-baremetal' openstackdocs_pdf_link = True openstackdocs_use_storyboard = True # Output file base name for HTML help builder. htmlhelp_basename = 'networking-baremetaldoc' latex_use_xindy = False # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass # [howto/manual]). latex_documents = [ ('index', 'doc-networking-baremetal.tex', u'Networking Baremetal Documentation', u'OpenStack Foundation', 'manual'), ] # Example configuration for intersphinx: refer to the Python standard library. #intersphinx_mapping = {'http://docs.python.org/': None} # -- sphinxcontrib.apidoc configuration -------------------------------------- apidoc_module_dir = '../../networking_baremetal' apidoc_output_dir = 'contributor/api' apidoc_excluded_paths = [ 'tests', ] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6066525 networking-baremetal-5.2.0.dev5/doc/source/configuration/0000775000175000017500000000000014221364417022507 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/doc/source/configuration/config.rst0000664000175000017500000000047314154223530024505 0ustar00coreycorey===================== Configuration Options ===================== The following is an overview of all available configuration options in networking-baremetal. For a sample configuration file, refer to :doc:`sample-config`. .. show-options:: :config-file: tools/config/networking-baremetal-config-generator.conf././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/doc/source/configuration/index.rst0000664000175000017500000000044414154223530024345 0ustar00coreycorey======================= Configuration Reference ======================= The following pages describe configuration options that can be used to adjust the service to your particular situation. .. toctree:: :maxdepth: 1 Configuration Options Sample Config File ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/doc/source/configuration/sample-config.rst0000664000175000017500000000123314154223530025757 0ustar00coreycorey========================= Sample Configuration File ========================= The following is a sample ironic-neutron-agent configuration for adaptation and use. For a detailed overview of all available configuration options, refer to :doc:`config`. The sample configuration can also be viewed in :download:`file form `. .. important:: The sample configuration file is auto-generated from networking-baremetal when this documentation is built. You must ensure your version of networking-baremetal matches the version of this documentation. .. literalinclude:: /_static/ironic_neutron_agent.ini.conf.sample././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6066525 networking-baremetal-5.2.0.dev5/doc/source/contributor/0000775000175000017500000000000014221364417022212 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/doc/source/contributor/index.rst0000664000175000017500000000421614154223530024051 0ustar00coreycorey============ Contributing ============ This document provides some necessary points for developers to consider when writing and reviewing networking-baremetal code. Getting Started =============== If you're completely new to OpenStack and want to contribute to the networking-baremetal project, please start by familiarizing yourself with the `Infra Team's Developer Guide `_. This will help you get your accounts set up in Launchpad and Gerrit, familiarize you with the workflow for the OpenStack continuous integration and testing systems, and help you with your first commit. LaunchPad Project ----------------- Most of the tools used for OpenStack require a launchpad.net ID for authentication. .. seealso:: * https://launchpad.net * https://launchpad.net/ironic Related Projects ---------------- Networking Baremetal is tightly integrated with the ironic and neutron projects. Ironic and its related projects are developed by the same community. .. seealso:: * https://launchpad.net/ironic * https://launchpad.net/neutron Project Hosting Details ----------------------- Bug tracker https://bugs.launchpad.net/networking-baremetal Mailing list (prefix Subject line with ``[ironic][networking-baremetal]``) http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-discuss Code Hosting https://opendev.org/openstack/networking-baremetal Code Review https://review.opendev.org/#/q/status:open+project:openstack/networking-baremetal,n,z Developer quick-starts ====================== These are quick walk throughs to get you started developing code for networking-baremetal. These assume you are already familiar with submitting code reviews to an OpenStack project. .. toctree:: :maxdepth: 2 Deploying networking-baremetal with DevStack Deploying networking-baremetal and multi-tenant networking with DevStack Full networking-baremetal python API reference ============================================== * :ref:`modindex` .. # api/modules is hidden since it's in the modindex link above. .. toctree:: :hidden: api/modules ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/doc/source/contributor/quickstart-multitenant.rst0000664000175000017500000001126014154223530027473 0ustar00coreycoreyDeploying networking-baremetal and multi-tenant networking with DevStack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DevStack may be configured to deploy networking-baremetal Networking service plugin together with networking-generic-switch for multi-tenant networking. It is highly recommended to deploy on an expendable virtual machine and not on your personal work station. Deploying networking-baremetal with DevStack requires a machine running Ubuntu 14.04 (or later) or Fedora 20 (or later). .. seealso:: http://docs.openstack.org/devstack/latest Create ``devstack/local.conf`` with minimal settings required to enable networking-baremetal with ironic and networking-generic-switch for multi-tenant networking. Here is an example of local.conf:: [[local|localrc]] # Credentials ADMIN_PASSWORD=password DATABASE_PASSWORD=password RABBIT_PASSWORD=password SERVICE_PASSWORD=password SERVICE_TOKEN=password SWIFT_HASH=password SWIFT_TEMPURL_KEY=password # Install networking-generic-switch Neutron ML2 driver that interacts with OVS enable_plugin networking-generic-switch https://opendev.org/openstack/networking-generic-switch # Enable networking-baremetal plugin enable_plugin networking-baremetal https://opendev.org/openstack/networking-baremetal.git enable_service networking_baremetal enable_service ir-neutronagt # Add link local info when registering Ironic node IRONIC_USE_LINK_LOCAL=True IRONIC_ENABLED_NETWORK_INTERFACES=flat,neutron IRONIC_NETWORK_INTERFACE=neutron #Networking configuration OVS_PHYSICAL_BRIDGE=brbm PHYSICAL_NETWORK=mynetwork IRONIC_PROVISION_NETWORK_NAME=ironic-provision IRONIC_PROVISION_PROVIDER_NETWORK_TYPE=vlan IRONIC_PROVISION_SUBNET_PREFIX=10.0.5.0/24 IRONIC_PROVISION_SUBNET_GATEWAY=10.0.5.1 Q_PLUGIN=ml2 ENABLE_TENANT_VLANS=True Q_ML2_TENANT_NETWORK_TYPE=vlan TENANT_VLAN_RANGE=100:150 Q_USE_PROVIDERNET_FOR_PUBLIC=False # Enable segments service_plugin for routed networks Q_SERVICE_PLUGIN_CLASSES=neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,segments IRONIC_USE_NEUTRON_SEGMENTS=True # Configure ironic from ironic devstack plugin. enable_plugin ironic https://opendev.org/openstack/ironic # Enable Ironic API and Ironic Conductor enable_service ironic enable_service ir-api enable_service ir-cond # Enable Neutron which is required by Ironic and disable nova-network. disable_service n-net disable_service n-novnc enable_service q-svc enable_service q-agt enable_service q-dhcp enable_service q-l3 enable_service q-meta enable_service neutron # Enable Swift for agent_* drivers enable_service s-proxy enable_service s-object enable_service s-container enable_service s-account # Disable Horizon disable_service horizon # Disable Heat disable_service heat h-api h-api-cfn h-api-cw h-eng # Disable Cinder disable_service cinder c-sch c-api c-vol # Swift temp URL's are required for agent_* drivers. SWIFT_ENABLE_TEMPURLS=True # Create 3 virtual machines to pose as Ironic's baremetal nodes. IRONIC_VM_COUNT=3 IRONIC_BAREMETAL_BASIC_OPS=True DEFAULT_INSTANCE_TYPE=baremetal # Enable additional hardware types, if needed. #IRONIC_ENABLED_HARDWARE_TYPES=ipmi,fake-hardware # Don't forget that many hardware types require enabling of additional # interfaces, most often power and management: #IRONIC_ENABLED_MANAGEMENT_INTERFACES=ipmitool,fake #IRONIC_ENABLED_POWER_INTERFACES=ipmitool,fake # The 'ipmi' hardware type's default deploy interface is 'iscsi'. # This would change the default to 'direct': #IRONIC_DEFAULT_DEPLOY_INTERFACE=direct # Change this to alter the default driver for nodes created by devstack. # This driver should be in the enabled list above. IRONIC_DEPLOY_DRIVER=ipmi # The parameters below represent the minimum possible values to create # functional nodes. IRONIC_VM_SPECS_RAM=1024 IRONIC_VM_SPECS_DISK=10 # Size of the ephemeral partition in GB. Use 0 for no ephemeral partition. IRONIC_VM_EPHEMERAL_DISK=0 # To build your own IPA ramdisk from source, set this to True IRONIC_BUILD_DEPLOY_RAMDISK=False VIRT_DRIVER=ironic # By default, DevStack creates a 10.0.0.0/24 network for instances. # If this overlaps with the hosts network, you may adjust with the # following. NETWORK_GATEWAY=10.1.0.1 FIXED_RANGE=10.1.0.0/24 FIXED_NETWORK_SIZE=256 # Log all output to files LOGFILE=$HOME/devstack.log LOGDIR=$HOME/logs IRONIC_VM_LOG_DIR=$HOME/ironic-bm-logs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/doc/source/contributor/quickstart.rst0000664000175000017500000000673014154223530025137 0ustar00coreycoreyDeploying networking-baremetal with DevStack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DevStack may be configured to deploy networking-baremetal Networking service plugin. It is highly recommended to deploy on an expendable virtual machine and not on your personal work station. Deploying networking-baremetal with DevStack requires a machine running Ubuntu 14.04 (or later) or Fedora 20 (or later). .. seealso:: http://docs.openstack.org/devstack/latest Create ``devstack/local.conf`` with minimal settings required to enable networking-baremetal with ironic. Here is an example of local.conf:: cd devstack cat >local.conf <`_ Indices and tables ================== * :ref:`genindex` * :ref:`search` ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6066525 networking-baremetal-5.2.0.dev5/doc/source/install/0000775000175000017500000000000014221364417021306 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/doc/source/install/index.rst0000664000175000017500000000622314154223530023145 0ustar00coreycorey============ Installation ============ This section describes how to install and configure the ``networking-baremetal`` plugin and ``ironic-neutron-agent``. The ``ironic-neutron-agent`` is a neutron agent that populates the host to physical network mapping for baremetal nodes in neutron. Neutron uses this to calculate the segment to host mapping information. Install the networking-baremetal plugin and agent ------------------------------------------------- At the command line: .. code-block:: shell $ pip install networking-baremetal Or, if you have neutron installed in a virtualenv, install the ``networking-baremetal`` plugin to the same virtualenv: .. code-block:: shell $ . /bin/activate $ pip install networking-baremetal Or, use the package from your distribution. For RHEL7/CentOS7: .. code-block:: shell $ yum install python2-networking-baremetal python2-ironic-neutron-agent Enable baremetal mechanism driver in the Networking service ----------------------------------------------------------- To enable mechanism drivers in the ML2 plug-in, edit the ``/etc/neutron/plugins/ml2/ml2_conf.ini`` configuration file. For example, this enables the ``openvswitch`` and ``baremetal`` mechanism drivers: .. code-block:: ini [ml2] mechanism_drivers = openvswitch,baremetal Configure ironic-neutron-agent ------------------------------ To configure the baremetal neutron agent, edit the neutron configuration ``/etc/neutron/plugins/ml2/ironic_neutron_agent.ini`` file. Add an ``[ironic]`` section. For example: .. code-block:: ini [ironic] project_domain_name = Default project_name = service user_domain_name = Default password = password username = ironic auth_url = http://identity-server.example.com/identity auth_type = password os_region = RegionOne Start ironic-neutron-agent service ---------------------------------- To start the agent either run it from the command line like in the example below or add it to the init system. .. code-block:: shell $ ironic-neutron-agent \ --config-dir /etc/neutron \ --config-file /etc/neutron/plugins/ml2/ironic_neutron_agent.ini \ --log-file /var/log/neutron/ironic_neutron_agent.log You can create a systemd service file ``/etc/systemd/system/ironic-neutron-agent.service`` for ``ironic-neutron-agent`` for systemd based distributions. For example: .. code-block:: ini [Unit] Description=OpenStack Ironic Neutron Agent After=syslog.target network.target [Service] Type=simple User=neutron PermissionsStartOnly=true TimeoutStartSec=0 Restart=on-failure ExecStart=/usr/bin/ironic-neutron-agent --config-dir /etc/neutron --config-file /etc/neutron/plugins/ml2/ironic_neutron_agent.ini --log-file /var/log/neutron/ironic-neutron-agent.log PrivateTmp=true KillMode=process [Install] WantedBy=multi-user.target .. Note:: systemd service file may be already available if you are installing from package released by linux distributions. Enable and start the ``ironic-neutron-agent`` service: .. code-block:: shell $ sudo systemctl enable ironic-neutron-agent.service $ sudo systemctl start ironic-neutron-agent.service ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/lower-constraints.txt0000664000175000017500000000245214154223530022027 0ustar00coreycoreyBabel==2.3.4 Jinja2==2.10 MarkupSafe==0.23 alembic==0.9.6 amqp==2.6.1 appdirs==1.3.0 asn1crypto==0.21.0 attrs==16.3.0 cachetools==1.1.0 cffi==1.13 cliff==2.8.0 cmd2==1.0.0 colorama==0.3.7 contextlib2==0.4.0 coverage==4.0 cryptography==2.8 debtcollector==1.2.0 decorator==4.0.0 dnspython==1.15.0 dogpile.cache==0.9.2 eventlet==0.25.2 fasteners==0.7 futurist==1.2.0 greenlet==0.4.16 httplib2==0.9.1 idna==2.1 iso8601==0.1.11 jmespath==0.9.0 jsonpatch==1.16 jsonpointer==1.9 jsonschema==2.6.0 keystoneauth1==3.14.0 keystonemiddleware==4.17.0 kombu==4.2.0 mock==2.0.0 monotonic==1.4 mox3==0.20.0 msgpack==0.6.0 munch==2.1.0 netaddr==0.7.18 netifaces==0.10.4 neutron-lib==1.28.0 neutron==14.0.0.0b1 openstacksdk==0.31.2 os-client-config==1.28.0 os-ken==0.3.0 os-traits==0.9.0 os-xenapi==0.3.4 osc-lib==1.8.0 oslo.cache==1.26.0 oslo.concurrency==3.26.0 oslo.config==5.2.0 oslo.context==2.19.2 oslo.db==9.1.0 oslo.i18n==3.15.3 oslo.log==3.36.0 oslo.messaging==5.29.0 oslo.middleware==3.31.0 oslo.policy==1.30.0 oslo.privsep==2.3.0 oslo.service==1.40.2 oslo.upgradecheck==0.1.0 oslo.utils==3.40.2 oslotest==3.2.0 paramiko==2.0.0 pbr==3.1.1 positional==1.1.1 python-neutronclient==6.7.0 python-subunit==1.0.0 requests==2.14.2 statsd==3.2.1 stestr==2.0.0 tenacity==6.0.0 testscenarios==0.4 testtools==2.2.0 tinyrpc==0.6 tooz==2.5.1 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6106527 networking-baremetal-5.2.0.dev5/networking_baremetal/0000775000175000017500000000000014221364417021776 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/__init__.py0000664000175000017500000000124414154223530024103 0ustar00coreycorey# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import pbr.version __version__ = pbr.version.VersionInfo( 'networking_baremetal').version_string() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/_i18n.py0000664000175000017500000000140714154223530023263 0ustar00coreycorey# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import oslo_i18n DOMAIN = "networking_baremetal" _translators = oslo_i18n.TranslatorFactory(domain=DOMAIN) # The primary translation function using the well-known name "_" _ = _translators.primary ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6106527 networking-baremetal-5.2.0.dev5/networking_baremetal/agent/0000775000175000017500000000000014221364417023074 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/agent/__init__.py0000664000175000017500000000000014154223530025166 0ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/agent/ironic_neutron_agent.py0000664000175000017500000002573214154223530027665 0ustar00coreycorey# Copyright 2017 Cisco Systems, Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import socket import sys from urllib import parse as urlparse import eventlet # oslo_messaging/notify/listener.py documents that monkeypatching is required eventlet.monkey_patch() from neutron.agent import rpc as agent_rpc from neutron.common import config as common_config from neutron.conf.agent import common as agent_config from neutron_lib.agent import topics from neutron_lib import constants as n_const from neutron_lib import context from openstack import exceptions as sdk_exc from oslo_config import cfg from oslo_log import log as logging import oslo_messaging from oslo_service import loopingcall from oslo_service import service from oslo_utils import timeutils from oslo_utils import uuidutils from tooz import hashring from networking_baremetal import constants from networking_baremetal import ironic_client CONF = cfg.CONF LOG = logging.getLogger(__name__) CONF.import_group('AGENT', 'neutron.plugins.ml2.drivers.agent.config') def list_opts(): return [('agent', agent_config.AGENT_STATE_OPTS)] def _get_notification_transport_url(): url = urlparse.urlparse(CONF.transport_url) if CONF.oslo_messaging_rabbit.amqp_auto_delete is False: q = urlparse.parse_qs(url.query) q.update({'amqp_auto_delete': ['true']}) query = urlparse.urlencode({k: v[0] for k, v in q.items()}) url = url._replace(query=query) return urlparse.urlunparse(url) def _set_up_notifier(transport, uuid): return oslo_messaging.Notifier( transport, publisher_id='ironic-neutron-agent-' + uuid, driver='messagingv2', topics=['ironic-neutron-agent-member-manager']) def _set_up_listener(transport, agent_id): targets = [ oslo_messaging.Target(topic='ironic-neutron-agent-member-manager')] endpoints = [HashRingMemberManagerNotificationEndpoint()] return oslo_messaging.get_notification_listener( transport, targets, endpoints, executor='eventlet', pool=agent_id) class HashRingMemberManagerNotificationEndpoint(object): """Class variables members and hashring is shared by all instances""" filter_rule = oslo_messaging.NotificationFilter( publisher_id='^ironic-neutron-agent.*') members = [] hashring = hashring.HashRing([]) def info(self, ctxt, publisher_id, event_type, payload, metadata): timestamp = timeutils.utcnow_ts() # Add members or update timestamp for existing members if not payload['id'] in [x['id'] for x in self.members]: try: LOG.info('Adding member id %s on host %s to hashring.', payload['id'], payload['host']) self.hashring.add_node(payload['id']) self.members.append(payload) except Exception: LOG.exception('Failed to add member %s to hash ring!', payload['id']) else: for member in self.members: if payload['id'] == member['id']: member['timestamp'] = payload['timestamp'] # Remove members that have not checked in for a while for member in self.members: if (timestamp - member['timestamp']) > ( CONF.AGENT.report_interval * 3): try: LOG.info('Removing member %s on host %s from hashring.', member['id'], member['host']) self.hashring.remove_node(member['id']) self.members.remove(member) except Exception: LOG.exception('Failed to remove member %s from hash ring!', member['id']) return oslo_messaging.NotificationResult.HANDLED class BaremetalNeutronAgent(service.ServiceBase): def __init__(self): self.context = context.get_admin_context_without_session() self.agent_id = uuidutils.generate_uuid(dashed=True) self.agent_host = socket.gethostname() # Set up oslo_messaging notifier and listener to keep track of other # members # NOTE(hjensas): Override the control_exchange for the notification # transport to allow setting amqp_auto_delete = true. # TODO(hjensas): Remove this and override the exchange when setting up # the notifier once the fix for bug is available. # https://bugs.launchpad.net/oslo.messaging/+bug/1814797 CONF.set_override('control_exchange', 'ironic-neutron-agent') self.transport = oslo_messaging.get_notification_transport( CONF, url=_get_notification_transport_url()) self.notifier = _set_up_notifier(self.transport, self.agent_id) # Note(hjensas): We need to have listener consuming the non-pool queue. # See bug: https://bugs.launchpad.net/oslo.messaging/+bug/1814544 self.listener = _set_up_listener(self.transport, None) self.pool_listener = _set_up_listener(self.transport, '-'.join( ['ironic-neutron-agent-member-manager-pool', self.agent_id])) self.member_manager = HashRingMemberManagerNotificationEndpoint() self.state_rpc = agent_rpc.PluginReportStateAPI(topics.REPORTS) self.ironic_client = ironic_client.get_client() self.reported_nodes = {} LOG.info('Agent networking-baremetal initialized.') def start(self): LOG.info('Starting agent networking-baremetal.') self.pool_listener.start() self.listener.start() self.notify_agents = loopingcall.FixedIntervalLoopingCall( self._notify_peer_agents) self.notify_agents.start(interval=(CONF.AGENT.report_interval / 3)) self.heartbeat = loopingcall.FixedIntervalLoopingCall( self._report_state) self.heartbeat.start(interval=CONF.AGENT.report_interval, initial_delay=CONF.AGENT.report_interval) def stop(self): LOG.info('Stopping agent networking-baremetal.') self.heartbeat.stop() self.notify_agents.stop() self.listener.stop() self.pool_listener.stop() self.listener.wait() self.pool_listener.wait() def reset(self): LOG.info('Resetting agent networking-baremetal.') self.heartbeat.stop() self.notify_agents.stop() self.listener.stop() self.pool_listener.stop() self.listener.wait() self.pool_listener.wait() def wait(self): pass def _notify_peer_agents(self): try: self.notifier.info({ 'ironic-neutron-agent': 'heartbeat'}, 'ironic-neutron-agent-member-manager', {'id': self.agent_id, 'host': self.agent_host, 'timestamp': timeutils.utcnow_ts()}) except Exception: LOG.exception('Failed to send hash ring membership hearbeat!') def get_template_node_state(self, node_uuid): return { 'binary': constants.BAREMETAL_BINARY, 'host': node_uuid, 'topic': n_const.L2_AGENT_TOPIC, 'configurations': { 'bridge_mappings': {}, 'log_agent_heartbeats': CONF.AGENT.log_agent_heartbeats, }, 'start_flag': False, 'agent_type': constants.BAREMETAL_AGENT_TYPE} def _report_state(self): node_states = {} ironic_ports = self.ironic_client.ports(details=True) # NOTE: the above calls returns a generator, so we need to handle # exceptions that happen just before the first loop iteration, when # the actual request to ironic happens try: for port in ironic_ports: node = port.node_id if (self.agent_id not in self.member_manager.hashring[node.encode('utf-8')]): continue template_node_state = self.get_template_node_state(node) node_states.setdefault(node, template_node_state) mapping = node_states[ node]["configurations"]["bridge_mappings"] if port.physical_network is not None: mapping[port.physical_network] = "yes" except sdk_exc.OpenStackCloudException: LOG.exception("Failed to get ironic ports data! " "Not reporting state.") return for state in node_states.values(): # If the node was not previously reported with current # configuration set the start_flag True. if not state['configurations'] == self.reported_nodes.get( state['host']): state.update({'start_flag': True}) LOG.info('Reporting state for host agent %s with new ' 'configuration: %s', state['host'], state['configurations']) try: LOG.debug('Reporting state for host: %s with configuration: ' '%s', state['host'], state['configurations']) self.state_rpc.report_state(self.context, state) except AttributeError: # This means the server does not support report_state LOG.exception("Neutron server does not support state report. " "State report for this agent will be disabled.") self.heartbeat.stop() # Don't continue reporting the remaining agents in this case. return except Exception: LOG.exception("Failed reporting state!") # Don't continue reporting the remaining nodes if one failed. return self.reported_nodes.update( {state['host']: state['configurations']}) def _unregiser_deprecated_opts(): CONF.reset() CONF.unregister_opts( [CONF._groups[ironic_client.IRONIC_GROUP]._opts[opt]['opt'] for opt in ironic_client._deprecated_opts], group=ironic_client.IRONIC_GROUP) def main(): # TODO(hjensas): Imports from neutron in ironic_neutron_agent registers the # client options. We need to unregister the options we are deprecating # first to avoid DuplicateOptError. Remove this when dropping deprecations. _unregiser_deprecated_opts() common_config.init(sys.argv[1:]) common_config.setup_logging() agent = BaremetalNeutronAgent() launcher = service.launch(cfg.CONF, agent, restart_method='mutate') launcher.wait() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/constants.py0000664000175000017500000000131414154223530024356 0ustar00coreycorey# Copyright 2017 Cisco Systems, Inc. # All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. BAREMETAL_AGENT_TYPE = "Baremetal Node" BAREMETAL_BINARY = 'ironic-neutron-agent' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/ironic_client.py0000664000175000017500000000642314154223530025171 0ustar00coreycorey# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from keystoneauth1 import loading import openstack from oslo_config import cfg from oslo_log import log as logging import tenacity CONF = cfg.CONF LOG = logging.getLogger(__name__) _IRONIC_SESSION = None IRONIC_GROUP = 'ironic' _deprecated_opts = {} _deprecated_opts['endpoint_override'] = [ cfg.DeprecatedOpt('ironic_url', group=IRONIC_GROUP)] _deprecated_opts['region_name'] = [ cfg.DeprecatedOpt('os_region', group=IRONIC_GROUP)] _deprecated_opts['status_code_retries'] = [ cfg.DeprecatedOpt('max_retries', group=IRONIC_GROUP)] _deprecated_opts['status_code_retry_delay'] = [ cfg.DeprecatedOpt('retry_interval', group=IRONIC_GROUP)] IRONIC_OPTS = [ cfg.StrOpt('auth_strategy', default='keystone', deprecated_for_removal=True, deprecated_reason='This option is no longer used, please use ' 'the [ironic]/auth_type option instead.', choices=('keystone', 'noauth'), help='Method to use for authentication: noauth or keystone.'), ] def list_opts(): return [ (IRONIC_GROUP, IRONIC_OPTS + loading.get_adapter_conf_options(deprecated_opts=_deprecated_opts) + loading.get_session_conf_options(deprecated_opts=_deprecated_opts) + loading.get_auth_plugin_conf_options('v3password'))] def get_session(group): loading.register_adapter_conf_options(CONF, group, deprecated_opts=_deprecated_opts) loading.register_session_conf_options(CONF, group, deprecated_opts=_deprecated_opts) loading.register_auth_conf_options(CONF, group) CONF.register_opts(IRONIC_OPTS, group=group) auth = loading.load_auth_from_conf_options(CONF, group) session = loading.load_session_from_conf_options(CONF, group, auth=auth) return session def _get_ironic_session(): global _IRONIC_SESSION if not _IRONIC_SESSION: _IRONIC_SESSION = get_session(IRONIC_GROUP) return _IRONIC_SESSION @tenacity.retry( retry=tenacity.retry_if_exception_type(openstack.exceptions.NotSupported), wait=tenacity.wait_exponential(max=30)) def get_client(): """Get an ironic client connection.""" session = _get_ironic_session() try: return openstack.connection.Connection( session=session, oslo_conf=CONF).baremetal except openstack.exceptions.NotSupported as exc: LOG.error('Ironic API might not be running, failed to establish a ' 'connection with ironic, reason: %s. Retrying ...', exc) raise except Exception as exc: LOG.error('Failed to establish a connection with ironic, reason: %s', exc) raise ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6106527 networking-baremetal-5.2.0.dev5/networking_baremetal/plugins/0000775000175000017500000000000014221364417023457 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/plugins/__init__.py0000664000175000017500000000000014154223530025551 0ustar00coreycorey././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6106527 networking-baremetal-5.2.0.dev5/networking_baremetal/plugins/ml2/0000775000175000017500000000000014221364417024151 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/plugins/ml2/__init__.py0000664000175000017500000000000014154223530026243 0ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/plugins/ml2/baremetal_mech.py0000664000175000017500000003320014154223530027444 0ustar00coreycorey# Copyright 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from neutron.db import provisioning_blocks from neutron.plugins.ml2.drivers import mech_agent from neutron_lib.api.definitions import portbindings from neutron_lib.callbacks import resources from neutron_lib import constants as n_const from neutron_lib.plugins.ml2 import api from oslo_log import log as logging from networking_baremetal import constants LOG = logging.getLogger(__name__) BAREMETAL_DRV_ENTITY = 'BAREMETAL_DRV_ENTITIY' class BaremetalMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase): def __init__(self): super(BaremetalMechanismDriver, self).__init__( constants.BAREMETAL_AGENT_TYPE, portbindings.VIF_TYPE_OTHER, {}, supported_vnic_types=[portbindings.VNIC_BAREMETAL]) def get_allowed_network_types(self, agent): """Return the agent's or driver's allowed network types. For example: return ('flat', ...). You can also refer to the configuration the given agent exposes. """ return [n_const.TYPE_FLAT, n_const.TYPE_VLAN] def get_mappings(self, agent): """Return the agent's bridge or interface mappings. For example: agent['configurations'].get('bridge_mappings', {}). """ return agent['configurations'].get('bridge_mappings', {}) def create_network_precommit(self, context): """Allocate resources for a new network. Create a new network, allocating resources as necessary in the database. Called inside transaction context on session. Call cannot block. Raising an exception will result in a rollback of the current transaction. :param context: NetworkContext instance describing the new network. """ pass def create_network_postcommit(self, context): """Create a network. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will cause the deletion of the resource. :param context: NetworkContext instance describing the new network. """ pass def update_network_precommit(self, context): """Update resources of a network. Update values of a network, updating the associated resources in the database. Called inside transaction context on session. Raising an exception will result in rollback of the transaction. update_network_precommit is called for all changes to the network state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. :param context: NetworkContext instance describing the new state of the network, as well as the original state prior to the update_network call. """ pass def update_network_postcommit(self, context): """Update a network. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will cause the deletion of the resource. update_network_postcommit is called for all changes to the network state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. :param context: NetworkContext instance describing the new state of the network, as well as the original state prior to the update_network call. """ pass def delete_network_precommit(self, context): """Delete resources for a network. Delete network resources previously allocated by this mechanism driver for a network. Called inside transaction context on session. Runtime errors are not expected, but raising an exception will result in rollback of the transaction. :param context: NetworkContext instance describing the current state of the network, prior to the call to delete it. """ pass def delete_network_postcommit(self, context): """Delete a network. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Runtime errors are not expected, and will not prevent the resource from being deleted. :param context: NetworkContext instance describing the current state of the network, prior to the call to delete it. """ pass def create_subnet_precommit(self, context): """Allocate resources for a new subnet. Create a new subnet, allocating resources as necessary in the database. Called inside transaction context on session. Call cannot block. Raising an exception will result in a rollback of the current transaction. :param context: SubnetContext instance describing the new subnet. """ pass def create_subnet_postcommit(self, context): """Create a subnet. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will cause the deletion of the resource. :param context: SubnetContext instance describing the new subnet. """ pass def update_subnet_precommit(self, context): """Update resources of a subnet. Update values of a subnet, updating the associated resources in the database. Called inside transaction context on session. Raising an exception will result in rollback of the transaction. update_subnet_precommit is called for all changes to the subnet state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. :param context: SubnetContext instance describing the new state of the subnet, as well as the original state prior to the update_subnet call. """ pass def update_subnet_postcommit(self, context): """Update a subnet. Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will cause the deletion of the resource. update_subnet_postcommit is called for all changes to the subnet state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. :param context: SubnetContext instance describing the new state of the subnet, as well as the original state prior to the update_subnet call. """ pass def delete_subnet_precommit(self, context): """Delete resources for a subnet. Delete subnet resources previously allocated by this mechanism driver for a subnet. Called inside transaction context on session. Runtime errors are not expected, but raising an exception will result in rollback of the transaction. :param context: SubnetContext instance describing the current state of the subnet, prior to the call to delete it. """ pass def delete_subnet_postcommit(self, context): """Delete a subnet.a Called after the transaction commits. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Runtime errors are not expected, and will not prevent the resource from being deleted. :param context: SubnetContext instance describing the current state of the subnet, prior to the call to delete it. """ pass def create_port_precommit(self, context): """Allocate resources for a new port. Create a new port, allocating resources as necessary in the database. Called inside transaction context on session. Call cannot block. Raising an exception will result in a rollback of the current transaction. :param context: PortContext instance describing the port. """ pass def create_port_postcommit(self, context): """Create a port. Called after the transaction completes. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will result in the deletion of the resource. :param context: PortContext instance describing the port. """ pass def update_port_precommit(self, context): """Update resources of a port. Called inside transaction context on session to complete a port update as defined by this mechanism driver. Raising an exception will result in rollback of the transaction. update_port_precommit is called for all changes to the port state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. :param context: PortContext instance describing the new state of the port, as well as the original state prior to the update_port call. """ pass def update_port_postcommit(self, context): """Update a port. Called after the transaction completes. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Raising an exception will result in the deletion of the resource. update_port_postcommit is called for all changes to the port state. It is up to the mechanism driver to ignore state or state changes that it does not know or care about. :param context: PortContext instance describing the new state of the port, as well as the original state prior to the update_port call. """ port = context.current if (port[portbindings.VNIC_TYPE] in self.supported_vnic_types and port[portbindings.VIF_TYPE] == self.vif_type): provisioning_blocks.provisioning_complete( context._plugin_context, port['id'], resources.PORT, BAREMETAL_DRV_ENTITY) def delete_port_precommit(self, context): """Delete resources of a port. Called inside transaction context on session. Runtime errors are not expected, but raising an exception will result in rollback of the transaction. :param context: PortContext instance describing the current state of the port, prior to the call to delete it. """ pass def delete_port_postcommit(self, context): """Delete a port. state of the port, prior to the call to delete it. Called after the transaction completes. Call can block, though will block the entire process so care should be taken to not drastically affect performance. Runtime errors are not expected, and will not prevent the resource from being deleted. :param context: PortContext instance describing the current state of the port, prior to the call to delete it. """ pass def try_to_bind_segment_for_agent(self, context, segment, agent): """Try to bind with segment for agent. :param context: PortContext instance describing the port :param segment: segment dictionary describing segment to bind :param agent: agents_db entry describing agent to bind :returns: True iff segment has been bound for agent Neutron segments api-ref: https://docs.openstack.org/api-ref/network/v2/#segments Example segment dictionary: {'segmentation_id': 'segmentation_id', 'network_type': 'network_type', 'id': 'segment_uuid'} Called outside any transaction during bind_port() so that derived MechanismDrivers can use agent_db data along with built-in knowledge of the corresponding agent's capabilities to attempt to bind to the specified network segment for the agent. If the segment can be bound for the agent, this function must call context.set_binding() with appropriate values and then return True. Otherwise, it must return False. """ if self.check_segment_for_agent(segment, agent): port = context.current provisioning_blocks.add_provisioning_component( context._plugin_context, port['id'], resources.PORT, BAREMETAL_DRV_ENTITY) context.set_binding(segment[api.ID], self.get_vif_type(context, agent, segment), self.get_vif_details(context, agent, segment)) return True else: return False ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6146526 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/0000775000175000017500000000000014221364417023140 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/__init__.py0000664000175000017500000000000014154223530025232 0ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/base.py0000664000175000017500000000143214154223530024417 0ustar00coreycorey# -*- coding: utf-8 -*- # Copyright 2010-2011 OpenStack Foundation # Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslotest import base class TestCase(base.BaseTestCase): """Test case base class for all unit tests.""" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6146526 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/0000775000175000017500000000000014221364417024117 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/__init__.py0000664000175000017500000000000014154223530026211 0ustar00coreycorey././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6146526 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/ironic_agent/0000775000175000017500000000000014221364417026560 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/ironic_agent/__init__.py0000664000175000017500000000000014154223530030652 0ustar00coreycorey././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/ironic_agent/test_hashring_member_manager.py 22 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/ironic_agent/test_hashring_member_ma0000664000175000017500000000701514154223530033347 0ustar00coreycorey# Copyright 2017 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import copy from unittest import mock from oslo_utils import timeutils from oslotest import base from networking_baremetal.agent import ironic_neutron_agent def fake_notification(): return (mock.Mock(), 'publisher_id', 'event_type', {'id': 'agent_id', 'host': 'agent_host', 'timestamp': timeutils.utcnow_ts()}, 'metadata') class TestHashRingMemberManagerNotificationEndpoint(base.BaseTestCase): def setUp(self): super(TestHashRingMemberManagerNotificationEndpoint, self).setUp() self.member_manager = ( ironic_neutron_agent.HashRingMemberManagerNotificationEndpoint()) self.member_manager.members = [] self.old_timestamp = 1517874977 @mock.patch.object(ironic_neutron_agent.LOG, 'info', autospec=True) def test_notification_info_add_new_agent(self, mock_log): self.member_manager.hashring = mock.Mock() ctxt, publisher_id, event_type, payload, metadata = fake_notification() self.member_manager.info(ctxt, publisher_id, event_type, payload, metadata) self.member_manager.hashring.add_node.assert_called_with(payload['id']) self.assertEqual(payload, self.member_manager.members[0]) self.assertEqual(1, mock_log.call_count) def test_notification_info_update_timestamp(self): self.member_manager.hashring = mock.Mock() ctxt, publisher_id, event_type, payload, metadata = fake_notification() # Set an old timestamp, and insert into members payload['timestamp'] = self.old_timestamp self.member_manager.members.append(copy.deepcopy(payload)) # Reset timestamp, and simulate notification, add_node not called # Timestamp in member manager is updated. payload['timestamp'] = timeutils.utcnow_ts() self.assertNotEqual(payload['timestamp'], self.member_manager.members[0]['timestamp']) self.member_manager.info(ctxt, publisher_id, event_type, payload, metadata) self.member_manager.hashring.add_node.assert_not_called() self.assertEqual(payload['timestamp'], self.member_manager.members[0]['timestamp']) @mock.patch.object(ironic_neutron_agent.LOG, 'info', autospec=True) def test_remove_old_members(self, mock_log): self.member_manager.hashring = mock.Mock() # Add a member with an old timestamp, it is removed. ctxt, publisher_id, event_type, payload, metadata = fake_notification() payload['timestamp'] = self.old_timestamp self.member_manager.info(ctxt, publisher_id, event_type, payload, metadata) self.member_manager.hashring.remove_node.assert_called_with( payload['id']) self.assertEqual(0, len(self.member_manager.members)) self.assertEqual(2, mock_log.call_count) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/ironic_agent/test_ironic_agent.py0000664000175000017500000003534614154223530032640 0ustar00coreycorey# Copyright 2017 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from unittest import mock from urllib import parse as urlparse from neutron.agent import rpc as agent_rpc from neutron.tests import base from neutron_lib import constants as n_const from openstack import connection from openstack import exceptions as sdk_exc from oslo_config import fixture as config_fixture from tooz import hashring from networking_baremetal.agent import ironic_neutron_agent from networking_baremetal import constants from networking_baremetal import ironic_client class FakePort1(object): def __init__(self, physnet='physnet1'): self.uuid = '11111111-2222-3333-4444-555555555555' self.node_id = '55555555-4444-3333-2222-111111111111' self.physical_network = physnet class FakePort2(object): def __init__(self, physnet='physnet2'): self.uuid = '11111111-aaaa-3333-4444-555555555555' self.node_id = '55555555-4444-3333-aaaa-111111111111' self.physical_network = physnet @mock.patch.object(ironic_client, '_get_ironic_session', autospec=True) @mock.patch.object(connection.Connection, 'baremetal', autospec=True) class TestBaremetalNeutronAgent(base.BaseTestCase): def setUp(self): super(TestBaremetalNeutronAgent, self).setUp() self.context = object() self.conf = self.useFixture(config_fixture.Config()) self.conf.config(transport_url='rabbit://user:password@host/') def test_get_template_node_state(self, mock_conn, mock_ir_client): self.agent = ironic_neutron_agent.BaremetalNeutronAgent() # Verify agent binary expected = constants.BAREMETAL_BINARY self.assertEqual(expected, self.agent.get_template_node_state( 'uuid')['binary']) # Verify agent_type is Baremetal Node expected = constants.BAREMETAL_AGENT_TYPE self.assertEqual(expected, self.agent.get_template_node_state( 'uuid')['agent_type']) # Verify topic expected = n_const.L2_AGENT_TOPIC self.assertEqual(expected, self.agent.get_template_node_state( 'uuid')['topic']) # Verify host expected = 'the_node_uuid' self.assertEqual(expected, self.agent.get_template_node_state( 'the_node_uuid')['host']) def test_report_state_one_node_one_port(self, mock_conn, mock_ir_client): self.agent = ironic_neutron_agent.BaremetalNeutronAgent() with mock.patch.object(self.agent.state_rpc, 'report_state', autospec=True) as mock_report_state: self.agent.ironic_client = mock_conn mock_conn.ports.return_value = iter([FakePort1()]) self.agent.agent_id = 'agent_id' self.agent.member_manager.hashring = hashring.HashRing( [self.agent.agent_id]) expected = { 'topic': n_const.L2_AGENT_TOPIC, 'start_flag': True, 'binary': constants.BAREMETAL_BINARY, 'host': '55555555-4444-3333-2222-111111111111', 'configurations': { 'bridge_mappings': { 'physnet1': 'yes' }, 'log_agent_heartbeats': False, }, 'agent_type': constants.BAREMETAL_AGENT_TYPE } self.agent._report_state() mock_report_state.assert_called_with(self.agent.context, expected) def test_report_state_with_log_agent_heartbeats(self, mock_conn, mock_ir_client): self.agent = ironic_neutron_agent.BaremetalNeutronAgent() with mock.patch.object(self.agent.state_rpc, 'report_state', autospec=True) as mock_report_state: self.conf.config(log_agent_heartbeats=True, group='AGENT') self.agent.ironic_client = mock_conn mock_conn.ports.return_value = iter([FakePort1()]) self.agent.agent_id = 'agent_id' self.agent.member_manager.hashring = hashring.HashRing( [self.agent.agent_id]) expected = { 'topic': n_const.L2_AGENT_TOPIC, 'start_flag': True, 'binary': constants.BAREMETAL_BINARY, 'host': '55555555-4444-3333-2222-111111111111', 'configurations': { 'bridge_mappings': { 'physnet1': 'yes' }, 'log_agent_heartbeats': True, }, 'agent_type': constants.BAREMETAL_AGENT_TYPE } self.agent._report_state() mock_report_state.assert_called_with(self.agent.context, expected) def test_start_flag_false_on_update_no_config_change(self, mock_conn, mock_ir_client): self.agent = ironic_neutron_agent.BaremetalNeutronAgent() with mock.patch.object(self.agent.state_rpc, 'report_state', autospec=True) as mock_report_state: self.agent.ironic_client = mock_conn mock_conn.ports.return_value = iter([FakePort1()]) self.agent.agent_id = 'agent_id' self.agent.member_manager.hashring = hashring.HashRing( [self.agent.agent_id]) expected = { 'topic': n_const.L2_AGENT_TOPIC, 'start_flag': 'PLACEHOLDER', 'binary': constants.BAREMETAL_BINARY, 'host': '55555555-4444-3333-2222-111111111111', 'configurations': { 'bridge_mappings': { 'physnet1': 'yes' }, 'log_agent_heartbeats': False, }, 'agent_type': constants.BAREMETAL_AGENT_TYPE } # First time report start_flag is True expected.update({'start_flag': True}) self.agent._report_state() mock_report_state.assert_called_with(self.agent.context, expected) # Subsequent times report start_flag is False mock_conn.ports.return_value = iter([FakePort1()]) expected.update({'start_flag': False}) self.agent._report_state() mock_report_state.assert_called_with(self.agent.context, expected) def test_start_flag_true_on_update_after_config_change(self, mock_conn, mock_ir_client): self.agent = ironic_neutron_agent.BaremetalNeutronAgent() with mock.patch.object(self.agent.state_rpc, 'report_state', autospec=True) as mock_report_state: self.agent.ironic_client = mock_conn mock_conn.ports.return_value = iter([FakePort1()]) self.agent.agent_id = 'agent_id' self.agent.member_manager.hashring = hashring.HashRing( [self.agent.agent_id]) expected = { 'topic': n_const.L2_AGENT_TOPIC, 'start_flag': 'PLACEHOLDER', 'binary': constants.BAREMETAL_BINARY, 'host': '55555555-4444-3333-2222-111111111111', 'configurations': { 'bridge_mappings': { 'physnet1': 'yes' }, 'log_agent_heartbeats': False, }, 'agent_type': constants.BAREMETAL_AGENT_TYPE } # First time report start_flag is True expected.update({'start_flag': True}) self.agent._report_state() mock_report_state.assert_called_with(self.agent.context, expected) # Subsequent times report start_flag is False mock_conn.ports.return_value = iter([FakePort1()]) expected.update({'start_flag': False}) self.agent._report_state() mock_report_state.assert_called_with(self.agent.context, expected) # After bridge_mapping config change start_flag is True once mock_conn.ports.return_value = iter( [FakePort1(physnet='new_physnet')]) expected.update({'configurations': { 'bridge_mappings': {'new_physnet': 'yes'}, 'log_agent_heartbeats': False}}) expected.update({'start_flag': True}) self.agent._report_state() mock_report_state.assert_called_with(self.agent.context, expected) # Subsequent times report start_flag is False mock_conn.ports.return_value = iter( [FakePort1(physnet='new_physnet')]) expected.update({'start_flag': False}) self.agent._report_state() mock_report_state.assert_called_with(self.agent.context, expected) def test_report_state_two_nodes_two_ports(self, mock_conn, mock_ir_client): self.agent = ironic_neutron_agent.BaremetalNeutronAgent() with mock.patch.object(self.agent.state_rpc, 'report_state', autospec=True) as mock_report_state: self.agent.ironic_client = mock_conn mock_conn.ports.return_value = iter([FakePort1(), FakePort2()]) self.agent.agent_id = 'agent_id' self.agent.member_manager.hashring = hashring.HashRing( [self.agent.agent_id]) expected1 = { 'topic': n_const.L2_AGENT_TOPIC, 'start_flag': True, 'binary': constants.BAREMETAL_BINARY, 'host': '55555555-4444-3333-2222-111111111111', 'configurations': { 'bridge_mappings': { 'physnet1': 'yes' }, 'log_agent_heartbeats': False, }, 'agent_type': constants.BAREMETAL_AGENT_TYPE } expected2 = { 'topic': n_const.L2_AGENT_TOPIC, 'start_flag': True, 'binary': constants.BAREMETAL_BINARY, 'host': '55555555-4444-3333-aaaa-111111111111', 'configurations': { 'bridge_mappings': { 'physnet2': 'yes' }, 'log_agent_heartbeats': False, }, 'agent_type': constants.BAREMETAL_AGENT_TYPE } self.agent._report_state() mock_report_state.assert_has_calls( [mock.call(self.agent.context, expected1), mock.call(self.agent.context, expected2)], any_order=True) @mock.patch.object(ironic_neutron_agent.LOG, 'exception', autospec=True) def test_ironic_port_list_fail(self, mock_log, mock_conn, mock_ir_client): self.agent = ironic_neutron_agent.BaremetalNeutronAgent() self.agent.ironic_client = mock_conn def mock_generator(details=None): raise sdk_exc.OpenStackCloudException() yield mock_conn.ports.side_effect = mock_generator self.agent._report_state() self.assertEqual(1, mock_log.call_count) @mock.patch.object(ironic_neutron_agent.LOG, 'exception', autospec=True) @mock.patch.object(agent_rpc, 'PluginReportStateAPI', autospec=True) def test_state_rpc_report_state_fail(self, mock_report_state, mock_log, mock_conn, mock_ir_client): self.agent = ironic_neutron_agent.BaremetalNeutronAgent() self.agent.agent_id = 'agent_id' self.agent.member_manager.hashring = hashring.HashRing( [self.agent.agent_id]) self.agent.ironic_client = mock_conn self.agent.state_rpc = mock_report_state mock_conn.ports.return_value = iter([FakePort1(), FakePort2()]) mock_report_state.report_state.side_effect = Exception() self.agent._report_state() self.assertEqual(1, mock_log.call_count) def test__get_notification_transport_url(self, mock_conn, mock_ir_client): self.assertEqual( 'rabbit://user:password@host/?amqp_auto_delete=true', ironic_neutron_agent._get_notification_transport_url()) self.conf.config(transport_url='rabbit://user:password@host:5672/') self.assertEqual( 'rabbit://user:password@host:5672/?amqp_auto_delete=true', ironic_neutron_agent._get_notification_transport_url()) self.conf.config(transport_url='rabbit://host:5672/') self.assertEqual( 'rabbit://host:5672/?amqp_auto_delete=true', ironic_neutron_agent._get_notification_transport_url()) self.conf.config(transport_url='rabbit://user:password@host/vhost') self.assertEqual( 'rabbit://user:password@host/vhost?amqp_auto_delete=true', ironic_neutron_agent._get_notification_transport_url()) self.conf.config( transport_url='rabbit://user:password@host/vhost?foo=bar') self.assertEqual( # NOTE(hjensas): Parse the url's when comparing, different versions # may sort the query different. urlparse.urlparse('rabbit://user:password@host/' 'vhost?foo=bar&amqp_auto_delete=true'), urlparse.urlparse( ironic_neutron_agent._get_notification_transport_url())) self.conf.config( transport_url=('rabbit://user:password@host/vhost?foo=bar&' 'amqp_auto_delete=false')) self.assertEqual( # NOTE(hjensas): Parse the url's when comparing, different versions # may sort the query different. urlparse.urlparse('rabbit://user:password@host' '/vhost?foo=bar&amqp_auto_delete=true'), urlparse.urlparse( ironic_neutron_agent._get_notification_transport_url())) def test__get_notification_transport_url_auto_delete_enabled( self, mock_conn, mock_ir_client): self.conf.config(amqp_auto_delete=True, group='oslo_messaging_rabbit') self.assertEqual( 'rabbit://user:password@host/', ironic_neutron_agent._get_notification_transport_url()) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6146526 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/plugins/0000775000175000017500000000000014221364417025600 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/plugins/__init__.py0000664000175000017500000000000014154223530027672 0ustar00coreycorey././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6146526 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/plugins/ml2/0000775000175000017500000000000014221364417026272 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/plugins/ml2/__init__.py0000664000175000017500000000000014154223530030364 0ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748813.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/plugins/ml2/test_baremetal_mech.py0000664000175000017500000002054714221364415032641 0ustar00coreycorey# Copyright 2017 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from unittest import mock from neutron.db import provisioning_blocks from neutron.plugins.ml2 import driver_context from neutron.tests.unit.plugins.ml2 import _test_mech_agent as base from neutron_lib.api.definitions import portbindings from neutron_lib import constants as n_const from neutron_lib.plugins.ml2 import api from networking_baremetal import constants from networking_baremetal.plugins.ml2 import baremetal_mech from networking_baremetal.tests.unit.plugins.ml2 import utils as ml2_utils class TestBaremetalMechDriver(base.AgentMechanismBaseTestCase): VIF_TYPE = portbindings.VIF_TYPE_OTHER VIF_DETAILS = None AGENT_TYPE = constants.BAREMETAL_AGENT_TYPE GOOD_CONFIGS = { 'bridge_mappings': {'fake_physical_network': 'fake_physnet'} } BAD_CONFIGS = { 'bridge_mappings': {'wrong_physical_network': 'wrong_physnet'} } AGENTS = [{'agent_type': AGENT_TYPE, 'alive': True, 'configurations': GOOD_CONFIGS, 'host': 'host'}] AGENTS_DEAD = [ {'agent_type': AGENT_TYPE, 'alive': False, 'configurations': GOOD_CONFIGS, 'host': 'dead_host'} ] AGENTS_BAD = [ {'agent_type': AGENT_TYPE, 'alive': False, 'configurations': GOOD_CONFIGS, 'host': 'bad_host_1'}, {'agent_type': AGENT_TYPE, 'alive': True, 'configurations': BAD_CONFIGS, 'host': 'bad_host_2'} ] VNIC_TYPE = portbindings.VNIC_BAREMETAL def setUp(self): super(TestBaremetalMechDriver, self).setUp() self.driver = baremetal_mech.BaremetalMechanismDriver() self.driver.initialize() def _make_port_ctx(self, agents): segments = [{api.ID: 'local_segment_id', api.PHYSICAL_NETWORK: 'fake_physical_network', api.NETWORK_TYPE: n_const.TYPE_FLAT}] return base.FakePortContext(self.AGENT_TYPE, agents, segments, vnic_type=self.VNIC_TYPE) def test_initialize(self): self.assertEqual([portbindings.VNIC_BAREMETAL], self.driver.supported_vnic_types) self.assertEqual(portbindings.VIF_TYPE_OTHER, self.driver.vif_type) @mock.patch.object(provisioning_blocks, 'add_provisioning_component', autospec=True) def test_bind_port(self, mpb_pc): port_context = self._make_port_ctx(self.AGENTS) port_context._plugin_context = 'plugin_context' self.assertIsNone(port_context._bound_vif_type) self.driver.bind_port(port_context) self.assertEqual(port_context._bound_vif_type, self.driver.vif_type) def test_get_allowed_network_types(self): agent_mock = mock.Mock() allowed_network_types = self.driver.get_allowed_network_types( agent_mock) self.assertEqual(allowed_network_types, [n_const.TYPE_FLAT, n_const.TYPE_VLAN]) @mock.patch.object(provisioning_blocks, 'provisioning_complete', autospec=True) def test_update_port_postcommit_not_bound(self, mpb_pc): m_nc = mock.create_autospec(driver_context.NetworkContext) m_nc.current = ml2_utils.get_test_network() m_pc = mock.create_autospec(driver_context.PortContext) m_pc.current = ml2_utils.get_test_port(network_id=m_nc.current['id']) m_pc.network = m_nc self.driver.update_port_postcommit(m_pc) self.assertFalse(mpb_pc.called) @mock.patch.object(provisioning_blocks, 'provisioning_complete', autospec=True) def test_update_port_postcommit_unsupported_vnic_type_not_bound( self, mpb_pc): m_nc = mock.create_autospec(driver_context.NetworkContext) m_nc.current = ml2_utils.get_test_network() m_pc = mock.create_autospec(driver_context.PortContext) m_pc.current = ml2_utils.get_test_port( network_id=m_nc.current['id'], vnic_type=portbindings.VNIC_MACVTAP, vif_type=portbindings.VIF_TYPE_OTHER) m_pc.network = m_nc self.driver.update_port_postcommit(m_pc) self.assertFalse(mpb_pc.called) @mock.patch.object(provisioning_blocks, 'provisioning_complete', autospec=True) def test_update_port_postcommit_supported_vnic_type_bound( self, mpb_pc): m_nc = mock.create_autospec(driver_context.NetworkContext) m_nc.current = ml2_utils.get_test_network() m_pc = mock.create_autospec(driver_context.PortContext) m_pc.current = ml2_utils.get_test_port( network_id=m_nc.current['id'], vnic_type=portbindings.VNIC_BAREMETAL, vif_type=portbindings.VIF_TYPE_OTHER) m_pc._plugin_context = 'plugin_context' m_pc.network = m_nc self.driver.update_port_postcommit(m_pc) mpb_pc.assert_called_once_with('plugin_context', m_pc.current['id'], 'port', 'BAREMETAL_DRV_ENTITIY') @mock.patch.object(provisioning_blocks, 'add_provisioning_component', autospec=True) def test_bind_port_unsupported_network_type(self, mpb_pc): m_nc = mock.create_autospec(driver_context.NetworkContext) m_nc.current = ml2_utils.get_test_network( network_type=n_const.TYPE_VXLAN) m_pc = mock.create_autospec(driver_context.PortContext) m_pc.current = ml2_utils.get_test_port( network_id=m_nc.current['id'], vnic_type=portbindings.VNIC_BAREMETAL, vif_type=portbindings.VIF_TYPE_OTHER) m_pc.network = m_nc m_pc.segments_to_bind = [ ml2_utils.get_test_segment(network_type=n_const.TYPE_VXLAN)] self.driver.bind_port(m_pc) self.assertFalse(mpb_pc.called) @mock.patch.object(provisioning_blocks, 'add_provisioning_component', autospec=True) def test_bind_port_unsupported_vnic_type(self, mpb_pc): m_nc = mock.create_autospec(driver_context.NetworkContext) m_nc.current = ml2_utils.get_test_network( network_type=n_const.TYPE_FLAT) m_pc = mock.create_autospec(driver_context.PortContext) m_pc.current = ml2_utils.get_test_port( network_id=m_nc.current['id'], vnic_type='unsupported') m_pc.network = m_nc m_pc.segments_to_bind = [ ml2_utils.get_test_segment(network_type=n_const.TYPE_FLAT)] self.driver.bind_port(m_pc) self.assertFalse(mpb_pc.called) def test_empty_methods(self): m_nc = mock.create_autospec(driver_context.NetworkContext) m_nc.current = ml2_utils.get_test_network() m_pc = mock.create_autospec(driver_context.PortContext) m_pc.current = ml2_utils.get_test_port(network_id=m_nc.current['id']) m_pc.network = m_nc.current m_sc = mock.create_autospec(driver_context.SubnetContext) m_sc.current = ml2_utils.get_test_subnet( network_id=m_nc.current['id']) m_sc.network = m_nc self.driver.create_network_precommit(m_nc) self.driver.create_network_postcommit(m_nc) self.driver.update_network_precommit(m_nc) self.driver.update_network_postcommit(m_nc) self.driver.delete_network_precommit(m_nc) self.driver.delete_network_postcommit(m_nc) self.driver.create_subnet_precommit(m_sc) self.driver.create_subnet_postcommit(m_sc) self.driver.update_subnet_precommit(m_sc) self.driver.update_subnet_postcommit(m_sc) self.driver.delete_subnet_precommit(m_sc) self.driver.delete_subnet_postcommit(m_sc) self.driver.create_port_precommit(m_pc) self.driver.create_port_postcommit(m_pc) self.driver.update_port_precommit(m_pc) self.driver.update_port_postcommit(m_pc) self.driver.delete_port_precommit(m_pc) self.driver.delete_port_postcommit(m_pc) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/networking_baremetal/tests/unit/plugins/ml2/utils.py0000664000175000017500000001202214154223530027774 0ustar00coreycorey# Copyright (c) 2017 Mirantis, Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_utils import uuidutils def get_test_network(**kw): """Return a network object with appropriate attributes.""" result = { "provider:physical_network": kw.get("physical_network", "mynetwork"), "ipv6_address_scope": kw.get("ipv6_address_scope", None), "revision_number": kw.get("revision_number", 7), "port_security_enabled": kw.get("port_security_enabled", True), "mtu": kw.get("mtu", 1500), "id": kw.get("id", uuidutils.generate_uuid()), "router:external": kw.get("router:external", False), "availability_zone_hints": kw.get("availability_zone_hints", []), "availability_zones": kw.get("availability_zones", ["nova"]), "ipv4_address_scope": kw.get("ipv4_address_scope", None), "shared": kw.get("shared", False), "project_id": kw.get("project_id", uuidutils.generate_uuid()), "status": kw.get("status", "ACTIVE"), "subnets": kw.get("subnets", []), "description": kw.get("description", ""), "tags": kw.get("tags", []), "provider:segmentation_id": kw.get("segmentation_id", 113), "name": kw.get("name", "private"), "admin_state_up": kw.get("admin_state_up", True), "tenant_id": kw.get("tenant_id", uuidutils.generate_uuid()), "provider:network_type": kw.get("network_type", "flat") } return result def get_test_port(network_id, **kw): """Return a port object with appropriate attributes.""" result = { "status": kw.get("status", "DOWN"), "binding:host_id": kw.get("host_id", "aaa.host"), "description": kw.get("description", ""), "allowed_address_pairs": kw.get("allowed_address_pairs", []), "tags": kw.get("tags", []), "extra_dhcp_opts": kw.get("extra_dhcp_opts", []), "device_owner": kw.get("device_owner", "baremetal:host"), "revision_number": kw.get("revision_number", 7), "port_security_enabled": kw.get("port_security_enabled", False), "binding:profile": kw.get("binding_profile", {'switch_info': 'foo', 'port_id': 'Gig0/1', 'switch_id': 'aa:bb:cc:dd:ee:ff'}), "fixed_ips": kw.get("fixed_ips", []), "id": kw.get("id", uuidutils.generate_uuid()), "security_groups": kw.get("security_groups", []), "device_id": kw.get("device_id", ""), "name": kw.get("name", "Port1"), "admin_state_up": kw.get("admin_state_up", True), "network_id": network_id, "tenant_id": kw.get("tenant_id", uuidutils.generate_uuid()), "binding:vif_details": kw.get("vif_details", {}), "binding:vnic_type": kw.get("vnic_type", "baremetal"), "binding:vif_type": kw.get("vif_type", "unbound"), "mac_address": kw.get("mac_address", "fa:16:3e:c2:2a:8f"), "project_id": kw.get("project_id", uuidutils.generate_uuid()) } return result def get_test_subnet(network_id, **kw): """Return a subnet object with appropriate attributes.""" result = { "service_types": kw.get("service_types", []), "description": kw.get("description", ""), "enable_dhcp": kw.get("enable_dhcp", True), "tags": kw.get("tags", []), "network_id": network_id, "tenant_id": kw.get("tenant_id", uuidutils.generate_uuid()), "dns_nameservers": kw.get("dns_nameservers", []), "gateway_ip": kw.get("gateway_ip", "10.1.0.1"), "ipv6_ra_mode": kw.get("ipv6_ra_mode", None), "allocation_pools": kw.get("allocation_pools", [{"start": "10.1.0.2", "end": "10.1.0.62"}]), "host_routes": kw.get("host_routes", []), "revision_number": kw.get("revision_number", 7), "ip_version": kw.get("ip_version", 4), "ipv6_address_mode": kw.get("ipv6_address_mode", None), "cidr": kw.get("cidr", "10.1.0.0/26"), "project_id": kw.get("project_id", uuidutils.generate_uuid()), "id": kw.get("id", uuidutils.generate_uuid()), "subnetpool_id": kw.get("subnetpool_id", uuidutils.generate_uuid()), "name": kw.get("name", "subnet0") } return result def get_test_segment(**kw): result = { 'segmentation_id': kw.get('segmentation_id', '123'), 'network_type': kw.get('network_type', 'flat'), 'id': uuidutils.generate_uuid() } return result ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6106527 networking-baremetal-5.2.0.dev5/networking_baremetal.egg-info/0000775000175000017500000000000014221364417023470 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748814.0 networking-baremetal-5.2.0.dev5/networking_baremetal.egg-info/PKG-INFO0000664000175000017500000000317714221364416024574 0ustar00coreycoreyMetadata-Version: 2.1 Name: networking-baremetal Version: 5.2.0.dev5 Summary: Neutron plugin that provides deep Ironic/Neutron integration. Home-page: https://docs.openstack.org/networking-baremetal/latest/ Author: OpenStack Author-email: openstack-discuss@lists.openstack.org License: UNKNOWN Platform: UNKNOWN Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Requires-Python: >=3.6 License-File: LICENSE License-File: AUTHORS networking-baremetal plugin --------------------------- This project's goal is to provide deep integration between the Networking service and the Bare Metal service and advanced networking features like notifications of port status changes and routed networks support in clouds with Bare Metal service. * Free software: Apache license * Documentation: http://docs.openstack.org/networking-baremetal/latest * Source: http://opendev.org/openstack/networking-baremetal * Bugs: https://storyboard.openstack.org/#!/project/955 * Release notes: https://docs.openstack.org/releasenotes/networking-baremetal/ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748814.0 networking-baremetal-5.2.0.dev5/networking_baremetal.egg-info/SOURCES.txt0000664000175000017500000000632014221364416025354 0ustar00coreycorey.stestr.conf AUTHORS CONTRIBUTING.rst ChangeLog HACKING.rst LICENSE MANIFEST.in README.rst babel.cfg lower-constraints.txt requirements.txt setup.cfg setup.py test-requirements.txt tox.ini devstack/plugin.sh devstack/settings devstack/lib/networking-baremetal doc/requirements.txt doc/source/conf.py doc/source/index.rst doc/source/configuration/config.rst doc/source/configuration/index.rst doc/source/configuration/sample-config.rst doc/source/contributor/index.rst doc/source/contributor/quickstart-multitenant.rst doc/source/contributor/quickstart.rst doc/source/install/index.rst networking_baremetal/__init__.py networking_baremetal/_i18n.py networking_baremetal/constants.py networking_baremetal/ironic_client.py networking_baremetal.egg-info/PKG-INFO networking_baremetal.egg-info/SOURCES.txt networking_baremetal.egg-info/dependency_links.txt networking_baremetal.egg-info/entry_points.txt networking_baremetal.egg-info/not-zip-safe networking_baremetal.egg-info/pbr.json networking_baremetal.egg-info/requires.txt networking_baremetal.egg-info/top_level.txt networking_baremetal/agent/__init__.py networking_baremetal/agent/ironic_neutron_agent.py networking_baremetal/plugins/__init__.py networking_baremetal/plugins/ml2/__init__.py networking_baremetal/plugins/ml2/baremetal_mech.py networking_baremetal/tests/__init__.py networking_baremetal/tests/base.py networking_baremetal/tests/unit/__init__.py networking_baremetal/tests/unit/ironic_agent/__init__.py networking_baremetal/tests/unit/ironic_agent/test_hashring_member_manager.py networking_baremetal/tests/unit/ironic_agent/test_ironic_agent.py networking_baremetal/tests/unit/plugins/__init__.py networking_baremetal/tests/unit/plugins/ml2/__init__.py networking_baremetal/tests/unit/plugins/ml2/test_baremetal_mech.py networking_baremetal/tests/unit/plugins/ml2/utils.py releasenotes/notes/.placeholder releasenotes/notes/add-initial-note-8f08fd95b0149b2c.yaml releasenotes/notes/agent-notification-auto-delete-queues-a3782fbeea2b57b1.yaml releasenotes/notes/distributed-agent-hashring-6b623a7a9caf0425.yaml releasenotes/notes/drop-py-2-7-2249129e616bb1e5.yaml releasenotes/notes/fix-exception-handling-openstacksdk-d3eff6f9fe9ea42f.yaml releasenotes/notes/fix-member-manager-notification-queue-not-consumed-449738d4fd799634.yaml releasenotes/notes/ironic-neutron-agent-291f8aad7d53f06c.yaml releasenotes/notes/mech-agent-driver-ffc361e528668f8e.yaml releasenotes/notes/replace-ironicclient-with-openstacksdk-75d1edd705571f94.yaml releasenotes/notes/sighup-service-reloads-configs-11cd374cc33aac83.yaml releasenotes/notes/vlan-type-support-mech-driver-31f907c76dc44923.yaml releasenotes/source/conf.py releasenotes/source/index.rst releasenotes/source/pike.rst releasenotes/source/queens.rst releasenotes/source/rocky.rst releasenotes/source/stein.rst releasenotes/source/train.rst releasenotes/source/unreleased.rst releasenotes/source/ussuri.rst releasenotes/source/victoria.rst releasenotes/source/wallaby.rst releasenotes/source/xena.rst releasenotes/source/yoga.rst releasenotes/source/_static/.placeholder releasenotes/source/_templates/.placeholder tools/flake8wrap.sh tools/run_bashate.sh tools/config/networking-baremetal-config-generator.conf zuul.d/networking-baremetal-jobs.yaml zuul.d/project.yaml././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748814.0 networking-baremetal-5.2.0.dev5/networking_baremetal.egg-info/dependency_links.txt0000664000175000017500000000000114221364416027535 0ustar00coreycorey ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748814.0 networking-baremetal-5.2.0.dev5/networking_baremetal.egg-info/entry_points.txt0000664000175000017500000000056714221364416026775 0ustar00coreycorey[console_scripts] ironic-neutron-agent = networking_baremetal.agent.ironic_neutron_agent:main [neutron.ml2.mechanism_drivers] baremetal = networking_baremetal.plugins.ml2.baremetal_mech:BaremetalMechanismDriver [oslo.config.opts] ironic-client = networking_baremetal.ironic_client:list_opts ironic-neutron-agent = networking_baremetal.agent.ironic_neutron_agent:list_opts ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999898.0 networking-baremetal-5.2.0.dev5/networking_baremetal.egg-info/not-zip-safe0000664000175000017500000000000114154223532025713 0ustar00coreycorey ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999898.0 networking-baremetal-5.2.0.dev5/networking_baremetal.egg-info/pbr.json0000664000175000017500000000005714154223532025145 0ustar00coreycorey{"git_version": "0fb52ac", "is_release": false}././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748814.0 networking-baremetal-5.2.0.dev5/networking_baremetal.egg-info/requires.txt0000664000175000017500000000035714221364416026074 0ustar00coreycoreykeystoneauth1>=3.14.0 neutron-lib>=1.28.0 neutron>=14.0.0.0b1 openstacksdk>=0.31.2 oslo.config>=5.2.0 oslo.i18n>=3.15.3 oslo.log>=3.36.0 oslo.messaging>=5.29.0 oslo.service>=1.40.2 oslo.utils>=3.40.2 pbr>=3.1.1 tenacity>=6.0.0 tooz>=2.5.1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748814.0 networking-baremetal-5.2.0.dev5/networking_baremetal.egg-info/top_level.txt0000664000175000017500000000002514221364416026216 0ustar00coreycoreynetworking_baremetal ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.5946524 networking-baremetal-5.2.0.dev5/releasenotes/0000775000175000017500000000000014221364417020264 5ustar00coreycorey././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6186526 networking-baremetal-5.2.0.dev5/releasenotes/notes/0000775000175000017500000000000014221364417021414 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/.placeholder0000664000175000017500000000000014154223530023660 0ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/add-initial-note-8f08fd95b0149b2c.yaml0000664000175000017500000000052614154223530027642 0ustar00coreycorey--- prelude: > This is the initial release of the networking-baremetal. The project includes the ``baremetal`` ml2 mechanism driver performing binding of the Networking service ports with ``binding_vnic_type=baremetal`` in flat networks. It also includes the devstack plugin to simplify the development setup and testing. ././@PaxHeader0000000000000000000000000000021600000000000010214 xustar00120 path=networking-baremetal-5.2.0.dev5/releasenotes/notes/agent-notification-auto-delete-queues-a3782fbeea2b57b1.yaml 22 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/agent-notification-auto-delete-queues-a3782fbeea20000664000175000017500000000303314154223530032435 0ustar00coreycorey--- upgrade: - | To fix `bug: 2004933 `_ oslo.messaging notification queues are now renamed and created with ``amqp_auto_delete=true``. When upgrading the agent old queues should be deleted to free up message broker resources. Previous queue that can be deleted are named ``ironic-neutron-agent-heartbeat.info``. There may also be queues with uuid of previous agent instances as name, these can also safely be deleted. (Look in the agent logs for relevant agent uuids). On rabbitmq queues can be deleted via the web console. For example with curl:: curl -i -u username:password \ -H "content-type:application/json" -XDELETE \ http://:/api/queues// Another example with vhost: '/' deleting the ironic-neutron-agent-heartbeat.info queue:: curl -i -u username:password \ -H "content-type:application/json" \ -XDELETE \ http://172.20.0.1:15672/api/queues/%2F/ironic-neutron-agent-heartbeat.info .. Note:: In the example above the vhost is ``/``. To ensure the vhost is correctly encoded the use of ``%2F``, instead of ``/`` is required. fixes: - | Fixes an issue where old oslo.messaging notification pool queues remained in the broker without any consumer after agent restart. The notification queues will now be created with ``amqp_auto_delete=true``. See `bug: 2004933 `_. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/distributed-agent-hashring-6b623a7a9caf0425.yaml0000664000175000017500000000056714154223530031731 0ustar00coreycorey--- features: - | Adds support for load distribution when multiple instances of the networking-baremetal agent are running. Each instance will manage a subset of bare metal nodes. In case one or more instances of networking-baremetal agent is lost, the remaining instances will take over the bare metal nodes previously managed by the lost instance(s). ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/drop-py-2-7-2249129e616bb1e5.yaml0000664000175000017500000000034614154223530026246 0ustar00coreycorey--- upgrade: - | Python 2.7 support has been dropped. Last release of Networking Baremetal to support Python 2.7 is OpenStack Train. The minimum version of Python now supported by Networking Baremetal is Python 3.6. ././@PaxHeader0000000000000000000000000000021400000000000010212 xustar00118 path=networking-baremetal-5.2.0.dev5/releasenotes/notes/fix-exception-handling-openstacksdk-d3eff6f9fe9ea42f.yaml 22 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/fix-exception-handling-openstacksdk-d3eff6f9fe9ea0000664000175000017500000000050714154223530032613 0ustar00coreycorey--- fixes: - | Fixed the incorrect handling of exceptions from openstacksdk when querying the list of ports from ironic, that caused the agent to stop reporting its state. Also when there are problems querying ports, agent now does not report an empty state, and rather waits for the next iteration to retry. ././@PaxHeader0000000000000000000000000000023300000000000010213 xustar00133 path=networking-baremetal-5.2.0.dev5/releasenotes/notes/fix-member-manager-notification-queue-not-consumed-449738d4fd799634.yaml 22 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/fix-member-manager-notification-queue-not-consume0000664000175000017500000000125714154223530033055 0ustar00coreycorey--- fixes: - | Fixes an issue causing heavy RAM (and/or-storage) usage on the message broker back-end. The ``ironic-neutron-agent`` uses oslo.messaging notifications, with all notification listeners using pools. Since all listeneres are using pools the default notification queue in messaging is not consumed (only the pool queues are consumed). The default notification queue was continously growing, consuming more and more resources on the messaging back-end. See `oslo.messaging bug: 1814544 `_ and `bug: 2004938 `_ for more details. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/ironic-neutron-agent-291f8aad7d53f06c.yaml0000664000175000017500000000107314154223530030642 0ustar00coreycorey--- features: - Add neutron agent ``ironic-neutron-agent`` to enable integration with neutron routed provider networks. The ml2 agent reports the state of ironic ports associated with ironic nodes to neutron, it populates the bridge_mappings configuration for each ironic node. The agent data can be used by the neutron segments plug-in in conjunction with neutron ml2 mechanism driver to ensure that port binding and ipam ip address allocations are taken from subnets associated with physical network segments available to the ironic port. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/mech-agent-driver-ffc361e528668f8e.yaml0000664000175000017500000000036614154223530030042 0ustar00coreycorey--- features: - Baremetal ml2 mechanism driver integration with the L2 agent. This enables the ml2 mechanism driver to use the agent_db data when binding ports. E.g the bridge mappings to enable binding on routed provider networks. ././@PaxHeader0000000000000000000000000000021700000000000010215 xustar00121 path=networking-baremetal-5.2.0.dev5/releasenotes/notes/replace-ironicclient-with-openstacksdk-75d1edd705571f94.yaml 22 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/replace-ironicclient-with-openstacksdk-75d1edd7050000664000175000017500000000170314154223530032455 0ustar00coreycorey--- upgrade: - | Operators using ironic-neutron-agent with ``noauth`` authentication strategy (i.e standalone ironic without keystone) must update the configuration. Replace ``[ironic]/auth_strategy = noauth`` with ``[ironic]/auth_type = none`` and set the ``[ironic]/endpoint_override`` option accordingly. deprecations: - | With the switch from ironicclient to openstacksdk the following options has been deprecated. * ``[ironic]/ironic_url`` replaced by ``[ironic]/endpoint_override`` * ``[ironic]/os_region`` replaced by ``[ironic]/region_name`` * ``[ironic]/retry_interval`` replaced by ``[ironic]/status_code_retries`` * ``[ironic]/max_retries`` replaced by ``[ironic]/status_code_retry_delay`` * ``[ironic]/auth_strategy`` is **ignored**, please use ``[ironic]/auth_type`` instead. other: - | Communication with ironic is now using openstacksdk, removing the dependency on ironicclient. ././@PaxHeader0000000000000000000000000000020700000000000010214 xustar00113 path=networking-baremetal-5.2.0.dev5/releasenotes/notes/sighup-service-reloads-configs-11cd374cc33aac83.yaml 22 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/sighup-service-reloads-configs-11cd374cc33aac83.y0000664000175000017500000000103214154223530032067 0ustar00coreycorey--- features: - | Issuing a SIGHUP (e.g. ``pkill -HUP ironic-neutron-agent``) to the agent service will cause the service to reload and use any changed values for *mutable* configuration options. Mutable configuration options are indicated as such in the `sample configuration file `_ by ``Note: This option can be changed without restarting``. A warning is logged for any changes to immutable configuration options. ././@PaxHeader0000000000000000000000000000020600000000000010213 xustar00112 path=networking-baremetal-5.2.0.dev5/releasenotes/notes/vlan-type-support-mech-driver-31f907c76dc44923.yaml 22 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/notes/vlan-type-support-mech-driver-31f907c76dc44923.ya0000664000175000017500000000133514154223530031664 0ustar00coreycorey--- features: - | Add support for type ``vlan`` networks in baremetal ml2 mechanism driver. This enables binding on networks using vlans for segmentation. It is only setting type ``vlan`` as supported. The intent is to use this in combination with another neutron mechanism driver that actually knows how to configure the network devices. .. Note:: The driver will **not** do anything to **set up** the correct **vlan tagging** in the network infrastructure such as switches or baremetal node ports. Another ml2 mechanism driver, or some other implementation, must be enabled to perform the necessary configuration on network devices. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6226528 networking-baremetal-5.2.0.dev5/releasenotes/source/0000775000175000017500000000000014221364417021564 5ustar00coreycorey././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6226528 networking-baremetal-5.2.0.dev5/releasenotes/source/_static/0000775000175000017500000000000014221364417023212 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/_static/.placeholder0000664000175000017500000000000014154223530025456 0ustar00coreycorey././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6226528 networking-baremetal-5.2.0.dev5/releasenotes/source/_templates/0000775000175000017500000000000014221364417023721 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/_templates/.placeholder0000664000175000017500000000000014154223530026165 0ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/conf.py0000664000175000017500000002162714154223530023066 0ustar00coreycorey# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. # Networking Baremetal Release Notes documentation build configuration file, # created by sphinx-quickstart on Tue Nov 3 17:40:50 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'openstackdocstheme', 'reno.sphinxext', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. copyright = u'2017, The Networking Baremetal team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. # The full version, including alpha/beta/rc tags. release = '' # The short X.Y version. version = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = [] # The reST default role (used for this markup: `text`) to use for all # documents. # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. # show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'native' # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'openstackdocs' # openstackdocstheme options openstackdocs_repo_name = 'openstack/networking-baremetal' openstackdocs_use_storyboard = True # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. # html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} # If false, no module index is generated. # html_domain_indices = True # If false, no index is generated. # html_use_index = True # If true, the index is split into individual pages for each letter. # html_split_index = False # If true, links to the reST sources are added to the pages. # html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'NetworkingBaremetalReleaseNotesdoc' # -- Options for LaTeX output --------------------------------------------- # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'NetworkingBaremetalReleaseNotes.tex', u'Networking Baremetal Release Notes Documentation', u'Networking Baremetal Developers', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. # latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. # latex_use_parts = False # If true, show page references after internal links. # latex_show_pagerefs = False # If true, show URL addresses after external links. # latex_show_urls = False # Documents to append as an appendix to all manuals. # latex_appendices = [] # If false, no module index is generated. # latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'networkingbaremetalreleasenotes', u'Networking Baremetal Release Notes Documentation', [u'Networking Baremetal Developers'], 1) ] # If true, show URL addresses after external links. # man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'NetworkingBaremetalReleaseNotes', u'Networking Baremetal Release Notes Documentation', u'networking Baremetal Developers', 'networkingbaremetalreleasenotes', 'Neutron plugin that provides deep Ironic/Neutron integration.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. # texinfo_appendices = [] # If false, no module index is generated. # texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. # texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. # texinfo_no_detailmenu = False # -- Options for Internationalization output ------------------------------ locale_dirs = ['locale/'] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748813.0 networking-baremetal-5.2.0.dev5/releasenotes/source/index.rst0000664000175000017500000000036714221364415023431 0ustar00coreycorey=================================== networking_baremetal Release Notes =================================== .. toctree:: :maxdepth: 1 unreleased yoga xena wallaby victoria ussuri train stein rocky queens pike ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/pike.rst0000664000175000017500000000021714154223530023241 0ustar00coreycorey=================================== Pike Series Release Notes =================================== .. release-notes:: :branch: stable/pike ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/queens.rst0000664000175000017500000000022314154223530023606 0ustar00coreycorey=================================== Queens Series Release Notes =================================== .. release-notes:: :branch: stable/queens ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/rocky.rst0000664000175000017500000000022114154223530023433 0ustar00coreycorey=================================== Rocky Series Release Notes =================================== .. release-notes:: :branch: stable/rocky ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/stein.rst0000664000175000017500000000022114154223530023426 0ustar00coreycorey=================================== Stein Series Release Notes =================================== .. release-notes:: :branch: stable/stein ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/train.rst0000664000175000017500000000026114154223530023425 0ustar00coreycorey=========================================== Train Series (1.4.0 - 1.4.x) Release Notes =========================================== .. release-notes:: :branch: stable/train ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/unreleased.rst0000664000175000017500000000016014154223530024435 0ustar00coreycorey============================== Current Series Release Notes ============================== .. release-notes:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/ussuri.rst0000664000175000017500000000020214154223530023635 0ustar00coreycorey=========================== Ussuri Series Release Notes =========================== .. release-notes:: :branch: stable/ussuri ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/victoria.rst0000664000175000017500000000021214154223530024124 0ustar00coreycorey============================= Victoria Series Release Notes ============================= .. release-notes:: :branch: stable/victoria ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/wallaby.rst0000664000175000017500000000020614154223530023742 0ustar00coreycorey============================ Wallaby Series Release Notes ============================ .. release-notes:: :branch: stable/wallaby ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/releasenotes/source/xena.rst0000664000175000017500000000017214154223530023244 0ustar00coreycorey========================= Xena Series Release Notes ========================= .. release-notes:: :branch: stable/xena ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748813.0 networking-baremetal-5.2.0.dev5/releasenotes/source/yoga.rst0000664000175000017500000000017214221364415023253 0ustar00coreycorey========================= Yoga Series Release Notes ========================= .. release-notes:: :branch: stable/yoga ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/requirements.txt0000664000175000017500000000115414154223530021053 0ustar00coreycorey# The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. neutron-lib>=1.28.0 # Apache-2.0 oslo.config>=5.2.0 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0 oslo.utils>=3.40.2 # Apache-2.0 oslo.messaging>=5.29.0 # Apache-2.0 oslo.service>=1.40.2 # Apache-2.0 pbr>=3.1.1 # Apache-2.0 openstacksdk>=0.31.2 # Apache-2.0 tooz>=2.5.1 # Apache-2.0 neutron>=14.0.0.0b1 # Apache-2.0 tenacity>=6.0.0 # Apache-2.0 keystoneauth1>=3.14.0 # Apache-2.0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6266527 networking-baremetal-5.2.0.dev5/setup.cfg0000664000175000017500000000341014221364417017412 0ustar00coreycorey[metadata] name = networking-baremetal summary = Neutron plugin that provides deep Ironic/Neutron integration. description_file = README.rst author = OpenStack author_email = openstack-discuss@lists.openstack.org home_page = https://docs.openstack.org/networking-baremetal/latest/ python_requires = >=3.6 classifier = Environment :: OpenStack Intended Audience :: Information Technology Intended Audience :: System Administrators License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 [files] packages = networking_baremetal [entry_points] oslo.config.opts = ironic-neutron-agent = networking_baremetal.agent.ironic_neutron_agent:list_opts ironic-client = networking_baremetal.ironic_client:list_opts console_scripts = ironic-neutron-agent = networking_baremetal.agent.ironic_neutron_agent:main neutron.ml2.mechanism_drivers = baremetal = networking_baremetal.plugins.ml2.baremetal_mech:BaremetalMechanismDriver [pbr] autodoc_index_modules = True api_doc_dir = contributor/api [compile_catalog] directory = networking_baremetal/locale domain = networking_baremetal [update_catalog] domain = networking_baremetal output_dir = networking_baremetal/locale input_file = networking_baremetal/locale/networking_baremetal.pot [extract_messages] keywords = _ gettext ngettext l_ lazy_gettext mapping_file = babel.cfg output_file = networking_baremetal/locale/networking_baremetal.pot [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/setup.py0000664000175000017500000000127114154223530017301 0ustar00coreycorey# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import setuptools setuptools.setup( setup_requires=['pbr>=2.0.0'], pbr=True) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/test-requirements.txt0000664000175000017500000000061614154223530022032 0ustar00coreycorey# The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. coverage!=4.4,>=4.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 python-subunit>=1.0.0 # Apache-2.0/BSD testtools>=2.2.0 # MIT stestr>=2.0.0 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6226528 networking-baremetal-5.2.0.dev5/tools/0000775000175000017500000000000014221364417016733 5ustar00coreycorey././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6226528 networking-baremetal-5.2.0.dev5/tools/config/0000775000175000017500000000000014221364417020200 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/tools/config/networking-baremetal-config-generator.conf0000664000175000017500000000026014154223530030410 0ustar00coreycorey[DEFAULT] output_file = etc/neutron/plugins/ml2/ironic_neutron_agent.ini.sample wrap_width = 79 namespace = ironic-neutron-agent namespace = oslo.log namespace = ironic-client ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/tools/flake8wrap.sh0000775000175000017500000000073514154223530021336 0ustar00coreycorey#!/bin/bash # # A simple wrapper around flake8 which makes it possible # to ask it to only verify files changed in the current # git HEAD patch. # # Intended to be invoked via tox: # # tox -epep8 -- -HEAD # if test "x$1" = "x-HEAD" ; then shift files=$(git diff --name-only HEAD~1 | tr '\n' ' ') echo "Running flake8 on ${files}" diff -u --from-file /dev/null ${files} | flake8 --diff "$@" else echo "Running flake8 on all files" exec flake8 "$@" fi ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/tools/run_bashate.sh0000775000175000017500000000242014154223530021556 0ustar00coreycorey#!/bin/bash # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. find "$@" -not \( -type d -name .?\* -prune \) \ -type f \ -not -name \*.swp \ -not -name \*~ \ -not -name \*.xml \ -not -name \*.template \ -not -name \*.py \ \( \ -name \*.sh -or \ -wholename \*/devstack/lib/\* -or \ -wholename \*/tools/\* \ \) \ -print0 | xargs -0 bashate -v -iE006 -eE005,E042 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1638999896.0 networking-baremetal-5.2.0.dev5/tox.ini0000664000175000017500000000622414154223530017105 0ustar00coreycorey[tox] minversion = 3.18.0 envlist = py3,pep8 skipsdist = True ignore_basepython_conflict=true [testenv] basepython = python3 usedevelop = True setenv = PYTHONWARNINGS=default::DeprecationWarning deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = stestr run {posargs} passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY [testenv:pep8] deps = bashate>=0.5.1 # Apache-2.0 flake8-import-order>=0.17.1 # LGPLv3 hacking>=4.1.0,<5.0.0 # Apache-2.0 pycodestyle>=2.0.0,<3.0.0 # MIT allowlist_externals = bash commands = bash tools/flake8wrap.sh {posargs} # Run bashate during pep8 runs to ensure violations are caught by # the check and gate queues. {toxinidir}/tools/run_bashate.sh {toxinidir}/devstack [testenv:venv] commands = {posargs} [testenv:cover] setenv = VIRTUAL_ENV={envdir} LANGUAGE=en_US PYTHON=coverage run --source networking_baremetal --parallel-mode commands = coverage erase stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml coverage report --omit='*test*' [testenv:docs] setenv = PYTHONHASHSEED=0 sitepackages = False deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html doc/source doc/build/html [testenv:pdf-docs] allowlist_externals = make setenv = PYTHONHASHSEED=0 sitepackages = False deps = {[testenv:docs]deps} commands = sphinx-build -b latex doc/source doc/build/pdf make -C doc/build/pdf [testenv:releasenotes] usedevelop = False deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:genconfig] commands = oslo-config-generator --config-file=tools/config/networking-baremetal-config-generator.conf [testenv:debug] commands = oslo_debug_helper -t networking_baremetal/tests/unit {posargs} [flake8] show-source = True # E123, E125 skipped as they are invalid PEP-8. # [W503] Line break occurred before a binary operator. Conflicts with W504. ignore = E123,E125,W503 # [H106] Don't put vim configuration in source files. # [H203] Use assertIs(Not)None to check for None. # [H204] Use assert(Not)Equal to check for equality. # [H205] Use assert(Greater|Less)(Equal) for comparison. # [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls # [H904] Delay string interpolations at logging calls. enable-extensions=H106,H203,H204,H205,H210,H904 builtins = _ exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build import-order-style = pep8 application-import-names = networking_baremetal filename = *.py per-file-ignores = networking_baremetal/agent/ironic_neutron_agent.py:E402 [testenv:lower-constraints] deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1648748814.6226528 networking-baremetal-5.2.0.dev5/zuul.d/0000775000175000017500000000000014221364417017014 5ustar00coreycorey././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748813.0 networking-baremetal-5.2.0.dev5/zuul.d/networking-baremetal-jobs.yaml0000664000175000017500000000454114221364415024756 0ustar00coreycorey- job: name: networking-baremetal-multitenant-vlans parent: ironic-base irrelevant-files: - ^.*\.rst$ - ^doc/.*$ - ^setup.cfg$ - ^test-requirements.txt$ - ^tools/.*$ - ^tox.ini$ required-projects: - openstack/networking-generic-switch - openstack/networking-baremetal vars: tempest_test_timeout: 2400 devstack_plugins: networking-generic-switch: https://opendev.org/openstack/networking-generic-switch networking-baremetal: https://opendev.org/openstack/networking-baremetal devstack_localrc: BUILD_TIMEOUT: 2400 ENABLE_TENANT_VLANS: True IRONIC_DEFAULT_DEPLOY_INTERFACE: direct IRONIC_DEFAULT_RESCUE_INTERFACE: "" IRONIC_ENABLED_NETWORK_INTERFACES: flat,neutron IRONIC_NETWORK_INTERFACE: neutron IRONIC_PROVISION_NETWORK_NAME: ironic-provision IRONIC_PROVISION_PROVIDER_NETWORK_TYPE: vlan IRONIC_PROVISION_SUBNET_GATEWAY: 10.0.5.1 IRONIC_PROVISION_SUBNET_PREFIX: 10.0.5.0/24 IRONIC_TEMPEST_BUILD_TIMEOUT: 2400 IRONIC_TEMPEST_WHOLE_DISK_IMAGE: True IRONIC_USE_LINK_LOCAL: True IRONIC_USE_NEUTRON_SEGMENTS: True IRONIC_VM_COUNT: 3 IRONIC_VM_EPHEMERAL_DISK: 0 IRONIC_AUTOMATED_CLEAN_ENABLED: False OVS_PHYSICAL_BRIDGE: brbm Q_USE_PROVIDERNET_FOR_PUBLIC: True PUBLIC_PHYSICAL_NETWORK: public OVS_BRIDGE_MAPPINGS: mynetwork:brbm,public:br-ex PHYSICAL_NETWORK: mynetwork Q_ML2_TENANT_NETWORK_TYPE: vlan Q_PLUGIN: ml2 Q_SERVICE_PLUGIN_CLASSES: neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,segments Q_USE_DEBUG_COMMAND: True SWIFT_ENABLE_TEMPURLS: True SWIFT_TEMPURL_KEY: secretkey TENANT_VLAN_RANGE: 100:150 EBTABLES_RACE_FIX: True devstack_services: s-account: True s-container: True s-object: True s-proxy: True generic_switch: True networking_baremetal: True ir-neutronagt: True neutron-api: False neutron-agent: False neutron-dhcp: False neutron-l3: False neutron-metadata-agent: False neutron-metering: False q-agt: True q-dhcp: True q-l3: True q-meta: True q-metering: True q-svc: True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1648748813.0 networking-baremetal-5.2.0.dev5/zuul.d/project.yaml0000664000175000017500000000055414221364415021350 0ustar00coreycorey- project: templates: - check-requirements - openstack-lower-constraints-master-branch-jobs - openstack-python3-zed-jobs-neutron - publish-openstack-docs-pti - release-notes-jobs-python3 check: jobs: - networking-baremetal-multitenant-vlans gate: jobs: - networking-baremetal-multitenant-vlans