diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 00000000..200caded --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,20 @@ +name: pre-commit + +on: + push: + branches: + - main + - develop + pull_request: + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - uses: pre-commit/action@v3.0.1 + - uses: pre-commit-ci/lite-action@v1.0.2 + if: always() diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 00000000..98b3f689 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,127 @@ +name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI + +on: push + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Install dunamai + run: >- + python3 -m + pip install + dunamai + --user + - name: Build a binary wheel and a source tarball + run: DYNAMIC_VERSION=$(dunamai from git --no-metadata) python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/ztpserver + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + + github-release: + name: >- + Sign the Python 🐍 distribution 📦 with Sigstore + and upload them to GitHub Release + needs: + - publish-to-pypi + runs-on: ubuntu-latest + + permissions: + contents: write # IMPORTANT: mandatory for making GitHub Releases + id-token: write # IMPORTANT: mandatory for sigstore + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Sign the dists with Sigstore + uses: sigstore/gh-action-sigstore-python@v1.2.3 + with: + inputs: >- + ./dist/*.tar.gz + ./dist/*.whl + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + '${{ github.ref_name }}' + --repo '${{ github.repository }}' + --notes "" + - name: Upload artifact signatures to GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + # Upload to GitHub Release using the `gh` CLI. + # `dist/` contains the built packages, and the + # sigstore-produced signatures and certificates. + run: >- + gh release upload + '${{ github.ref_name }}' dist/** + --repo '${{ github.repository }}' + + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to TestPyPI + if: ${{ github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') }} + needs: + - build + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/ztpserver + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 829eb366..5e0cee20 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -1,6 +1,11 @@ name: Pylint -on: [push] +on: + push: + branches: + - main + - develop + pull_request: jobs: build: @@ -9,9 +14,9 @@ jobs: matrix: python-version: ["3.7", "3.8", "3.9"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/unittest-node-py2.yml b/.github/workflows/unittest-node-py2.yml index 3986d516..c40b575b 100644 --- a/.github/workflows/unittest-node-py2.yml +++ b/.github/workflows/unittest-node-py2.yml @@ -1,6 +1,11 @@ name: Unittest Node py2 -on: [push] +on: + push: + branches: + - main + - develop + pull_request: jobs: build: @@ -12,7 +17,7 @@ jobs: env: USER: root steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/unittest-node.yml b/.github/workflows/unittest-node.yml index 3ddfcb9c..dc267180 100644 --- a/.github/workflows/unittest-node.yml +++ b/.github/workflows/unittest-node.yml @@ -1,6 +1,11 @@ name: Unittest Node -on: [push] +on: + push: + branches: + - main + - develop + pull_request: jobs: build: @@ -9,9 +14,9 @@ jobs: matrix: python-version: ["3.7", "3.8", "3.9"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.github/workflows/unittest-server.yml b/.github/workflows/unittest-server.yml index 4eac3ce5..e9a23fd3 100644 --- a/.github/workflows/unittest-server.yml +++ b/.github/workflows/unittest-server.yml @@ -1,6 +1,11 @@ name: Unittest server -on: [push] +on: + push: + branches: + - main + - develop + pull_request: jobs: build: @@ -9,9 +14,9 @@ jobs: matrix: python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 74575208..8b419474 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,17 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.5.0 hooks: - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 24.4.2 hooks: - id: black args: ["-l", "100"] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort name: isort (python) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92db5989..24ae13f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,4 +5,3 @@ ## 1.1.0 See http://ztpserver.readthedocs.org/en/v1.1.0/ReleaseNotes1.1.html - diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6cff4535..f66c1ad6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,9 +4,9 @@ Arista EOS+ ZTPServer provides a community based implementation of a bootstrap s Contributing Code ================= -Arista EOS+ ZTPServer provides all of its source available to anyone on Github at github.com/arista-eosplus/ztpserver. The project is freely available to anyone to fork and use in their own implementations. The Arista EOS+ community gladly accepts pull requests that add new features, enhance existing features or fix bugs. +Arista EOS+ ZTPServer provides all of its source available to anyone on Github at github.com/arista-eosplus/ztpserver. The project is freely available to anyone to fork and use in their own implementations. The Arista EOS+ community gladly accepts pull requests that add new features, enhance existing features or fix bugs. -All contributed code should be done using pull requests. Once a pull request is initiated, a member of the Arista EOS+ community will review the code and either accept it as is or provide feedback on things to change. +All contributed code should be done using pull requests. Once a pull request is initiated, a member of the Arista EOS+ community will review the code and either accept it as is or provide feedback on things to change. As a procedural note, all pull requests that add new features and/or enhance the operation of ZTPServer are expected to have corresponding test cases with them. Pull requests will be not accepted without them. @@ -16,7 +16,7 @@ Another available way to contribute to this project is to provide requests for f Bugs ==== -If you happen to find a bug with ZTPServer, please open an issue and flag it as a bug. In the issue description please provide details about what you were trying to do, any errors and/or tracebacks and any other information necessary to replicate the bug. +If you happen to find a bug with ZTPServer, please open an issue and flag it as a bug. In the issue description please provide details about what you were trying to do, any errors and/or tracebacks and any other information necessary to replicate the bug. Contact ======= diff --git a/INSTALL.md b/INSTALL.md index 3520b4b6..8fa81852 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -15,4 +15,4 @@ $ sudo easy_install PyYaml $ sudo make install $ ztps -`````` \ No newline at end of file +`````` diff --git a/Makefile b/Makefile index c033c098..996f2ae6 100644 --- a/Makefile +++ b/Makefile @@ -96,10 +96,10 @@ install: $(PYTHON) setup.py install sdist: clean ztpserver.spec - $(PYTHON) setup.py sdist + DYNAMIC_VERSION=$$(dunamai from git --no-metadata) $(PYTHON) setup.py sdist sdist-dev: clean ztpserver.spec - DEV_VERSION_HASH=$$(git rev-parse --short HEAD) $(PYTHON) setup.py sdist + DYNAMIC_VERSION=$$(dunamai from git) $(PYTHON) setup.py sdist docker_dev: sdist @docker build -t ${IMG} . diff --git a/VERSION b/VERSION index a69e5856..6c51535a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.1.dev0 +0.0.0 #uses dynamic version with: dunamai from git --no-metadata diff --git a/conf/bootstrap.conf b/conf/bootstrap.conf index 3f3b47ae..3bbb8057 100644 --- a/conf/bootstrap.conf +++ b/conf/bootstrap.conf @@ -15,4 +15,3 @@ # ... # # See documentation for the detailed list of possible values. - diff --git a/conf/neighbordb b/conf/neighbordb index f874ec90..5337fb51 100644 --- a/conf/neighbordb +++ b/conf/neighbordb @@ -22,4 +22,3 @@ # ... # # See documentation for the detailed list of possible values. - diff --git a/conf/ztpserver.conf b/conf/ztpserver.conf index 3df9ef1a..13fbec9e 100644 --- a/conf/ztpserver.conf +++ b/conf/ztpserver.conf @@ -23,10 +23,10 @@ disable_topology_validation = False [server] -# Note: this section only applies to using the standalone server. If +# Note: this section only applies to using the standalone server. If # running under a WSGI server, these values are ignored -# Interface to which the server will bind to (0:0:0:0 will bind to +# Interface to which the server will bind to (0:0:0:0 will bind to # all available IPv4 addresses on the local machine) interface = 0.0.0.0 diff --git a/conf/ztpserver.wsgi b/conf/ztpserver.wsgi index de23d187..c206f8cb 100644 --- a/conf/ztpserver.wsgi +++ b/conf/ztpserver.wsgi @@ -35,7 +35,7 @@ import sys from ztpserver.app import start_wsgiapp -sys.stdout.write('Starting ZTPServer...') +sys.stdout.write("Starting ZTPServer...") application = start_wsgiapp() # To enable debug output, use: diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 95c93c5e..1319a9bf 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -56,4 +56,3 @@ Building / Publishing Docs locally * `make` \(default make target is now `make html`\) * Open file://_build/html/index.html in your browser to view. * Publish by copying `docs/_build/html/*` to the `gh-pages` branch - diff --git a/docs/README.md b/docs/README.md index 5307b83f..da9bb53a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -19,4 +19,3 @@ Documenting REST APIs --------------------- REST APIs are documented via the [httpdomain](https://pythonhosted.org/sphinxcontrib-httpdomain/) plugin for sphinx. - diff --git a/docs/ReleaseNotes1.1.rst b/docs/ReleaseNotes1.1.rst index 253036eb..a072a47f 100644 --- a/docs/ReleaseNotes1.1.rst +++ b/docs/ReleaseNotes1.1.rst @@ -11,7 +11,7 @@ Enhancements * V1.1.0 docs (`181 `_) Documentation has been completely restructured and is now hosted at http://ztpserver.readthedocs.org/. * refresh_ztps - util script to refresh ZTP Server installation (`177 `_) - /utils/refresh_ztps can be used in order to automatically refresh the installation of ZTP Server to the latest code on GitHub. This can be useful in order to pull bug fixes or run the latest version of various development branches. + /utils/refresh_ztps can be used in order to automatically refresh the installation of ZTP Server to the latest code on GitHub. This can be useful in order to pull bug fixes or run the latest version of various development branches. * Et49 does not match Ethernet49 in neighbordb/pattern files (`172 `_) The local interface in an interface pattern does not have to use the long interface name. For example, all of the following will be treated similarly: Et1, e1, et1, eth1, Eth1, ethernet1, Ethernet1. @@ -100,8 +100,8 @@ Enhancements “domain”*: , “password”*: , “nickname”: , // REMOVED - “rooms”*: [ , … ] - “msg_type”: [ “info” | “debug” ] // Optional, default “debug” + “rooms”*: [ , … ] + “msg_type”: [ “info” | “debug” ] // Optional, default “debug” } } @@ -224,4 +224,3 @@ Resolved issues .. comment * fix issue with Pattern creation from neighbordb (`44 `_) .. comment - diff --git a/docs/ReleaseNotes1.2.rst b/docs/ReleaseNotes1.2.rst index f9b76d70..d051a38c 100644 --- a/docs/ReleaseNotes1.2.rst +++ b/docs/ReleaseNotes1.2.rst @@ -72,7 +72,7 @@ Enhancements s7056.lab.local - - [03/Nov/2014 21:05:33] "POST /nodes HTTP/1.1" 400 0 * Deal more gracefully with DNS/connectivity errors while trying to access remote syslog servers (`215 `_) - Logging errors (e.g. bogus destination) will not be automatically logged by the bootstrap script. In order to debug logging issues, simply uncomment the following lines in the bootstrap script: + Logging errors (e.g. bogus destination) will not be automatically logged by the bootstrap script. In order to debug logging issues, simply uncomment the following lines in the bootstrap script: :: #---------------------------------SYSLOG---------------------- @@ -179,4 +179,3 @@ Fixed * ZTPS server fails to write .node because lack of permissions (`126 `_) .. comment - diff --git a/docs/ReleaseNotes1.3.1.rst b/docs/ReleaseNotes1.3.1.rst index 7128db97..6680200d 100644 --- a/docs/ReleaseNotes1.3.1.rst +++ b/docs/ReleaseNotes1.3.1.rst @@ -9,4 +9,3 @@ Bug fixes ^^^^^^^^^ * fixes *pip* install/uninstall issues - diff --git a/docs/ReleaseNotes1.3.2.rst b/docs/ReleaseNotes1.3.2.rst index ea862096..ca4f0316 100644 --- a/docs/ReleaseNotes1.3.2.rst +++ b/docs/ReleaseNotes1.3.2.rst @@ -31,4 +31,3 @@ Bug fixes .. comment - ZTP Server benchmarking results .. comment - diff --git a/docs/ReleaseNotes1.3.rst b/docs/ReleaseNotes1.3.rst index 5bb6b83c..13b5b242 100644 --- a/docs/ReleaseNotes1.3.rst +++ b/docs/ReleaseNotes1.3.rst @@ -30,7 +30,7 @@ Enhancements Validating definitions... Validating /usr/share/ztpserver/definitions/leaf.definition... Ok! Validating /usr/share/ztpserver/definitions/leaf-no_vars.definition... Ok! - + Validating resources... Validating /usr/share/ztpserver/resources/leaf_man_ip... Ok! Validating /usr/share/ztpserver/resources/leaf_spine_ip... @@ -40,11 +40,11 @@ Enhancements 10.0.0.53/24: null dfdsf dsfsd 10.0.0.54/24: JPE14140273 - + Error: while scanning a simple key in "", line 3, column 1: - dfdsf dsfsd + dfdsf dsfsd could not found expected ':' in "", line 5, column 1: 10.0.0.54/24: JPE14140273 @@ -97,4 +97,3 @@ Bug fixes logging: xmpp: ... - diff --git a/docs/ReleaseNotes1.5.0.rst b/docs/ReleaseNotes1.5.0.rst index 3f217010..4d7ebf5c 100644 --- a/docs/ReleaseNotes1.5.0.rst +++ b/docs/ReleaseNotes1.5.0.rst @@ -25,5 +25,3 @@ Fixed Known Caveats ^^^^^^^^^^^^^ - - diff --git a/docs/actions.rst b/docs/actions.rst index 180a8a38..3877bae7 100644 --- a/docs/actions.rst +++ b/docs/actions.rst @@ -69,4 +69,3 @@ Actions # #.. automodule:: template # :members: - diff --git a/docs/api.rst b/docs/api.rst index 553da357..7874c2e8 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -130,16 +130,16 @@ provisioned. Content-Type: application/json { - “model”*: , - “serialnumber”*: , + “model”*: , + “serialnumber”*: , “systemmac”*: , - “version”*: , + “version”*: , “neighbors”*: { : [ { - 'device': , + 'device': , 'remote_interface': } ] - }, + }, } **Note**: \* Items are mandatory (even if value is empty list/dict) @@ -148,7 +148,7 @@ provisioned. Status: 201 Created OR 409 Conflict will both return: - .. sourcecode:: http + .. sourcecode:: http Content-Type: text/html Location: @@ -233,7 +233,7 @@ This is used to retrieve the startup-config that was backed-up from a node to th Status: 201 Created OR 409 Conflict will both return: - .. sourcecode:: http + .. sourcecode:: http Content-Type: text/plain diff --git a/docs/client.rst b/docs/client.rst index cea40fed..bfd68c7a 100644 --- a/docs/client.rst +++ b/docs/client.rst @@ -8,4 +8,3 @@ Bootstrap Client .. autoclass:: Node :members: - diff --git a/docs/conf.py b/docs/conf.py index 4e222c2a..f4aaa4de 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,38 +13,41 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import os import re +import sys + # on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' +on_rtd = os.environ.get("READTHEDOCS", None) == "True" if not on_rtd: # only import and set the theme if we're building docs locally import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' + + html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] -#sys.path.insert(0, os.path.join('ztpserver', 'lib')) -#sys.path.insert(0, os.path.join('ztpserver')) -sys.path.insert(0, os.path.join('..', 'actions')) -sys.path.insert(0, os.path.join('..', 'client')) -sys.path.insert(0, os.path.join('actions')) -sys.path.insert(0, os.path.join('client')) -sys.path.insert(0, os.path.abspath('..')) +# sys.path.insert(0, os.path.join('ztpserver', 'lib')) +# sys.path.insert(0, os.path.join('ztpserver')) +sys.path.insert(0, os.path.join("..", "actions")) +sys.path.insert(0, os.path.join("..", "client")) +sys.path.insert(0, os.path.join("actions")) +sys.path.insert(0, os.path.join("client")) +sys.path.insert(0, os.path.abspath("..")) # 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('.')) +# sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# 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 = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] +# extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] extensions = [ "sphinx.ext.autodoc", "sphinx.ext.viewcode", @@ -53,211 +56,205 @@ ] # Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] +templates_path = ["_templates"] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = ".rst" # The encoding of source files. -#source_encoding = 'utf-8-sig' +# source_encoding = 'utf-8-sig' # The master toctree document. -master_doc = 'index' +master_doc = "index" # General information about the project. -project = u'ZTPServer' -copyright = u'2015, Arista Networks' # pylint: disable=W0622 +project = "ZTPServer" +copyright = "2015, Arista Networks" # pylint: disable=W0622 # 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. -#version = '1.2.0' +# version = '1.2.0' # The full version, including alpha/beta/rc tags. -#release = '1.2.0' +# release = '1.2.0' -release = open('../VERSION').read().split()[0].strip() +release = open("../VERSION").read().split()[0].strip() # Assume PEP 440 version strings -p = re.compile('(\d+!)?((\d+)(.\d+)*(.\d+)*)(.?[a|b|rc]\d*)?(.post\d*)?(.dev\d*)?', re.IGNORECASE) -vers = p.search(release) +p = re.compile("(\d+!)?((\d+)(.\d+)*(.\d+)*)(.?[a|b|rc]\d*)?(.post\d*)?(.dev\d*)?", re.IGNORECASE) +vers = p.search(release) version = vers.group(2) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +# language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. -today_fmt = '%B %d, %Y' +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 = ['_build', 'old', 'exts', 'cookbook/_template.rst'] +exclude_patterns = ["_build", "old", "exts", "cookbook/_template.rst"] # The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# 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 +# add_module_names = True add_module_names = False # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False show_authors = True # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' +pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# modindex_common_prefix = [] # -- 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 = 'default' +# html_theme = 'default' # 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 = {} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". -#html_title = None +# html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None +# 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 -#html_logo = '_static/AristaLogo.png' -html_logo = '_static/arista_logo_11-trans-w.png' +# html_logo = None +# html_logo = '_static/AristaLogo.png' +html_logo = "_static/arista_logo_11-trans-w.png" # 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 -#html_favicon = 'favicon.ico' -html_favicon = '_static/favicon.ico' +# html_favicon = None +# html_favicon = 'favicon.ico' +html_favicon = "_static/favicon.ico" # 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'] +html_static_path = ["_static"] # 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' -html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' +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 +# html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = 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 = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Output file base name for HTML help builder. -htmlhelp_basename = 'ZTPServerdoc' +htmlhelp_basename = "ZTPServerdoc" # -- Options for LaTeX output -------------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # The paper size ('letterpaper' or 'a4paper'). + #'papersize': 'letterpaper', + # The font size ('10pt', '11pt' or '12pt'). + #'pointsize': '10pt', + # Additional stuff for the LaTeX preamble. + #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'ZTPServer.tex', u'ZTPServer Documentation', - u'Arista Networks', 'manual'), + ("index", "ZTPServer.tex", "ZTPServer Documentation", "Arista Networks", "manual"), ] # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = None -latex_logo = '_static/arista_logo_jpg-11.jpg' +# latex_logo = None +latex_logo = "_static/arista_logo_jpg-11.jpg" # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -#latex_use_parts = False +# latex_use_parts = False # If true, show page references after internal links. -#latex_show_pagerefs = False +# latex_show_pagerefs = False # If true, show URL addresses after external links. -#latex_show_urls = False +# latex_show_urls = False # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_domain_indices = True +# 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', 'ztpserver', u'ZTPServer Documentation', - [u'Arista Networks'], 1) -] +man_pages = [("index", "ztpserver", "ZTPServer Documentation", ["Arista Networks"], 1)] # If true, show URL addresses after external links. -#man_show_urls = False +# man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ @@ -266,16 +263,22 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'ZTPServer', u'ZTPServer Documentation', - u'Arista Networks', 'ZTPServer', 'One line description of project.', - 'Miscellaneous'), + ( + "index", + "ZTPServer", + "ZTPServer Documentation", + "Arista Networks", + "ZTPServer", + "One line description of project.", + "Miscellaneous", + ), ] # Documents to append as an appendix to all manuals. -#texinfo_appendices = [] +# texinfo_appendices = [] # If false, no module index is generated. -#texinfo_domain_indices = True +# texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' +# texinfo_show_urls = 'footnote' diff --git a/docs/cookbook/actions.rst b/docs/cookbook/actions.rst index 72d6c49f..04efd0d5 100644 --- a/docs/cookbook/actions.rst +++ b/docs/cookbook/actions.rst @@ -154,7 +154,7 @@ The ZTPServer will then write the SYSTEM_ID as the value, overwriting ``null``. If you wanted to use the assigned value elsewhere in the definition, simply call ``allocate(mgmt_subnet)`` and the plugin will not assign a new value, rather it will return the key already assigned. Note that this is an implementation-detail -specific to this particular plugin - other plugins might vary (please read the +specific to this particular plugin - other plugins might vary (please read the associated documentation for each). The result would look like: diff --git a/docs/cookbook/resourcePools.rst b/docs/cookbook/resourcePools.rst index 44912143..2c62c45a 100644 --- a/docs/cookbook/resourcePools.rst +++ b/docs/cookbook/resourcePools.rst @@ -86,6 +86,6 @@ Explanation Clearing all resource pools can be done via the command line on the ZTPServer. The command will analyze ``data_root/resources`` and any file that exists in -that directory that resembles a ZTPServer resource pool will be cleared. +that directory that resembles a ZTPServer resource pool will be cleared. .. End of Clearing a Resource Pool diff --git a/docs/cookbook/ztpsVMonEOS.rst b/docs/cookbook/ztpsVMonEOS.rst index b1ceb98b..ded0330f 100644 --- a/docs/cookbook/ztpsVMonEOS.rst +++ b/docs/cookbook/ztpsVMonEOS.rst @@ -56,4 +56,4 @@ Explanation The USB key method leverages the Arista Password Recovery mechanism. When the ``fullrecover`` and ``boot-config`` file is present on the USB key, the system will check the timestamp on the ``boot-config`` file.If the timestamp is different, all files on the USB key will be copied to the flash on the switch, and the switch will be rebooted and come up with the ``startup-config`` and the ``EOS.swi`` included on the USB key. -.. End of Deployment Steps \ No newline at end of file +.. End of Deployment Steps diff --git a/docs/cookbook/ztpsVMonEOS/l2wom.rst b/docs/cookbook/ztpsVMonEOS/l2wom.rst index 6ca953f8..234759a1 100644 --- a/docs/cookbook/ztpsVMonEOS/l2wom.rst +++ b/docs/cookbook/ztpsVMonEOS/l2wom.rst @@ -237,4 +237,4 @@ The reason we could not just bridge Vlan1 with the Linux bridge (and therefore j -.. End of ztps.xml \ No newline at end of file +.. End of ztps.xml diff --git a/docs/examples.rst b/docs/examples.rst index 7059af3a..8c88883f 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -13,41 +13,41 @@ Global configuration file [default] # Location of all ztps boostrap process data files data_root = /usr/share/ztpserver - + # UID used in the /nodes structure (serialnumber or systemmac) identifier = serialnumber - + # Server URL to-be-advertised to clients (via POST replies) during the bootstrap process server_url = http://172.16.130.10:8080 - + # Enable local logging logging = True - + # Enable console logging console_logging = True - + # Console logging format console_logging_format = %(asctime)s:%(levelname)s:[%(module)s:%(lineno)d] %(message)s # Globally disable topology validation in the bootstrap process disable_topology_validation = False - + [server] # Note: this section only applies to using the standalone server. If # running under a WSGI server, these values are ignored - + # Interface to which the server will bind to (0:0:0:0 will bind to # all available IPv4 addresses on the local machine) interface = 172.16.130.10 - + # TCP listening port port = 8080 - + [bootstrap] # Bootstrap filename (file located in /bootstrap) filename = bootstrap - + [neighbordb] # Neighbordb filename (file located in ) filename = neighbordb @@ -181,7 +181,7 @@ Sample templates .. _resources_example: -Sample resources +Sample resources ```````````````` :: @@ -219,11 +219,11 @@ Example #1 node: ABC12345678 interfaces: - Ethernet49: pod1-spine1:Ethernet1/1 - - Ethernet50: + - Ethernet50: device: pod1-spine2 port: Ethernet1/1 -In example #1, the topology map would only apply to a node with system ID +In example #1, the topology map would only apply to a node with system ID equal to **ABC12345678**. The following interface map rules apply: - Interface Ethernet49 must be connected to node pod1-spine1 on port @@ -242,7 +242,7 @@ Example #2 node: 001c73aabbcc interfaces: - any: regex('pod\d+-spine\d+'):Ethernet1/$ - - any: + - any: device: regex('pod\d+-spine1') port: Ethernet2/3 @@ -273,7 +273,7 @@ Example #3 - Ethernet2: $pod1-spine2:any - any: excludes('spine1'):Ethernet49 - any: excludes('spine2'):Ethernet49 - - Ethernet49: + - Ethernet49: device: $not_spine port: Ethernet49 - Ethernet50: @@ -372,4 +372,3 @@ More examples ````````````` Additional ZTPServer file examples are available on GitHub at the `ZTPServer Demo `_. - diff --git a/docs/internals.rst b/docs/internals.rst index 18055a50..b7fc381c 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -7,4 +7,3 @@ Internals implementation api modules - diff --git a/docs/overview.rst b/docs/overview.rst index 3733562c..d921f40d 100644 --- a/docs/overview.rst +++ b/docs/overview.rst @@ -3,7 +3,7 @@ Overview ZTPServer provides a robust server which enables comprehensive bootstrap solutions for Arista network elements. ZTPserver takes advantage of the the ZeroTouch Provisioning (ZTP) feature in Arista's EOS (Extensible Operating System) which enables a node to connect to a provisioning server whenever a valid configuration file is missing from the internal flash storage. -ZTPServer provides a number of features that extend beyond simply loading a configuration file and a boot image on a node, including: +ZTPServer provides a number of features that extend beyond simply loading a configuration file and a boot image on a node, including: * sending an advanced bootstrap client to the node * mapping each node to an individual definition which describes the bootstrap steps specific to that node @@ -12,7 +12,7 @@ ZTPServer provides a number of features that extend beyond simply loading a conf * validation topology using a simple syntax for expressing LLDP neighbor adjacencies * enabling Zero Touch Replacement, as well as configuration backup and management -ZTPServer is written in Python and leverages standard protocols like DHCP (DHCP options for boot functions), HTTP(S) (for bi-directional transport), XMPP and syslog (for logging). Most of the configuration files are YAML-based. +ZTPServer is written in Python and leverages standard protocols like DHCP (DHCP options for boot functions), HTTP(S) (for bi-directional transport), XMPP and syslog (for logging). Most of the configuration files are YAML-based. **Highlights:** @@ -51,7 +51,7 @@ See the `ZTP Tech Bulletin