Skip to content

Commit b82aebc

Browse files
authored
Merge pull request #1358 from napalm-automation/develop
Release 3.3.0
2 parents 6f05d1c + 0d3142b commit b82aebc

File tree

223 files changed

+158619
-510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+158619
-510
lines changed

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
ignore:
9+
- dependency-name: pytest
10+
versions:
11+
- ">= 6.a, < 7"
12+
- dependency-name: black
13+
versions:
14+
- 21.4b0
15+
- 21.4b1
16+
- dependency-name: tox
17+
versions:
18+
- 3.21.3
19+
- 3.22.0

.github/workflows/commit.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
name: build
3+
on: [push, pull_request]
4+
jobs:
5+
std_tests:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
max-parallel: 4
9+
matrix:
10+
python-version: [3.6, 3.7, 3.8, 3.9]
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Setup Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install -e .
25+
pip install -r requirements.txt
26+
pip install -r requirements-dev.txt
27+
28+
- name: Run black
29+
run: |
30+
black --check .
31+
32+
- name: Run linter
33+
run: |
34+
pylama .
35+
36+
- name: Run Tests
37+
run: |
38+
py.test --cov=napalm --cov-report term-missing -vs --pylama
39+
40+
build_docs:
41+
needs: std_tests
42+
runs-on: ubuntu-latest
43+
44+
strategy:
45+
matrix:
46+
python-version: [3.8]
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v2
51+
52+
- name: Setup Python ${{ matrix.python-version }}
53+
uses: actions/setup-python@v2
54+
with:
55+
python-version: ${{ matrix.python-version }}
56+
57+
- name: Install dependencies
58+
run: |
59+
python -m pip install --upgrade pip
60+
python -m pip install -e .
61+
pip install -r requirements.txt
62+
pip install -r requirements-dev.txt
63+
python -m pip install -r docs/requirements.txt
64+
65+
- name: Doctests
66+
run: |
67+
make doctest

.travis.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[![PyPI](https://img.shields.io/pypi/v/napalm.svg)](https://pypi.python.org/pypi/napalm)
22
[![PyPI versions](https://img.shields.io/pypi/pyversions/napalm.svg)](https://pypi.python.org/pypi/napalm)
3-
[![Build Status](https://travis-ci.org/napalm-automation/napalm.svg?branch=master)](https://travis-ci.org/napalm-automation/napalm)
43
[![Coverage Status](https://coveralls.io/repos/github/napalm-automation/napalm/badge.svg)](https://coveralls.io/github/napalm-automation/napalm)
54
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
65

docs/conf.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@
5454
master_doc = "index"
5555

5656
# General information about the project.
57-
project = u"NAPALM"
58-
copyright = u"2020, David Barroso"
57+
project = "NAPALM"
58+
copyright = "2021, David Barroso/Mircea Ulinic/Kirk Byers"
5959

6060
# The version info for the project you're documenting, acts as replacement for
6161
# |version| and |release|, also used in various other places throughout the
6262
# built documents.
6363
#
6464
# The short X.Y version.
65-
version = "0"
65+
version = "3"
6666
# The full version, including alpha/beta/rc tags.
6767
release = "3"
6868

@@ -284,6 +284,8 @@
284284
"cli",
285285
"close",
286286
"commit_config",
287+
"confirm_commit",
288+
"has_pending_commit",
287289
"compare_config",
288290
"discard_config",
289291
"load_merge_candidate",

docs/development/triage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Driver labels
2626
-------------
2727

2828
Each platform supported by NAPALM has associated a label, e.g., ``junos``, ``eos``,
29-
``ios``, ``iosxr``, ``vyos``, etc. It is mandatory that the maintainer to apply
29+
``ios``, ``iosxr_netconf``, ``iosxr``, ``vyos``, etc. It is mandatory that the maintainer to apply
3030
one or more of these labels.
3131

3232
.. _triage-api-change-label:

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ You can select the driver you need by doing the following:
3434
>>> from napalm import get_network_driver
3535
>>> get_network_driver('eos')
3636
<class napalm.eos.eos.EOSDriver at 0x10ebad6d0>
37+
>>> get_network_driver('iosxr_netconf')
38+
<class napalm.iosxr_netconf.iosxr_netconf.IOSXRNETCONFDriver at 0x10ad170f0>
3739
>>> get_network_driver('iosxr')
3840
<class napalm.iosxr.iosxr.IOSXRDriver at 0x10ec90050>
3941
>>> get_network_driver('junos')

docs/support/index.rst

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@ General support matrix
88

99

1010

11-
===================== ========== ============= ============ ============ ============ ============
12-
_ EOS Junos IOS-XR NX-OS NX-OS SSH IOS
13-
===================== ========== ============= ============ ============ ============ ============
14-
**Driver Name** eos junos iosxr nxos nxos_ssh ios
15-
**Structured data** Yes Yes No Yes No No
16-
**Minimum version** 4.15.0F 12.1 5.1.0 6.1 [#g1]_ 12.4(20)T
17-
**Backend library** `pyeapi`_ `junos-eznc`_ `pyIOSXR`_ `pynxos`_ `netmiko`_ `netmiko`_
18-
**Caveats** :doc:`eos` :doc:`nxos` :doc:`nxos` :doc:`ios`
19-
===================== ========== ============= ============ ============ ============ ============
11+
===================== ========== ============= ==================== ================== ============ ============ ============
12+
_ EOS Junos IOS-XR (NETCONF) IOS-XR (XML-Agent) NX-OS NX-OS SSH IOS
13+
===================== ========== ============= ==================== ================== ============ ============ ============
14+
**Driver Name** eos junos iosxr_netconf iosxr nxos nxos_ssh ios
15+
**Structured data** Yes Yes Yes No Yes No No
16+
**Minimum version** 4.15.0F 12.1 7.0 5.1.0 6.1 [#g1]_ 12.4(20)T 6.3.2
17+
**Backend library** `pyeapi`_ `junos-eznc`_ `ncclient`_ `pyIOSXR`_ `pynxos`_ `netmiko`_ `netmiko`_
18+
**Caveats** :doc:`eos` :doc:`iosxr_netconf` :doc:`nxos` :doc:`nxos` :doc:`ios`
19+
===================== ========== ============= ==================== ================== ============ ============ ============
2020

2121
.. _pyeapi: https://github.com/arista-eosplus/pyeapi
2222
.. _junos-eznc: https://github.com/Juniper/py-junos-eznc
2323
.. _pyIOSXR: https://github.com/fooelisa/pyiosxr
2424
.. _pynxos: https://github.com/networktocode/pynxos
2525
.. _netmiko: https://github.com/ktbyers/netmiko
26+
.. _ncclient: https://github.com/ncclient/ncclient
2627

2728
.. [#g1] NX-API support on the Nexus 5k, 6k and 7k families was introduced in version 7.2
2829
@@ -32,20 +33,22 @@ General support matrix
3233
Configuration support matrix
3334
----------------------------
3435

35-
===================== ========== ===== ========== ============== ==============
36-
_ EOS Junos IOS-XR NX-OS IOS
37-
===================== ========== ===== ========== ============== ==============
38-
**Config. replace** Yes Yes Yes Yes Yes
39-
**Config. merge** Yes Yes Yes Yes Yes
40-
**Compare config** Yes Yes Yes [#c1]_ Yes [#c4]_ Yes
41-
**Atomic Changes** Yes Yes Yes Yes/No [#c5]_ Yes/No [#c5]_
42-
**Rollback** Yes [#c2]_ Yes Yes Yes/No [#c5]_ Yes
43-
===================== ========== ===== ========== ============== ==============
36+
===================== ========== ===== ================ ================== ============== ==============
37+
_ EOS Junos IOS-XR (NETCONF) IOS-XR (XML-Agent) NX-OS IOS
38+
===================== ========== ===== ================ ================== ============== ==============
39+
**Config. replace** Yes Yes Yes Yes Yes Yes
40+
**Config. merge** Yes Yes Yes Yes Yes Yes
41+
**Commit Confirm** Yes Yes No No No No
42+
**Compare config** Yes Yes Yes Yes [#c1]_ Yes [#c4]_ Yes
43+
**Atomic Changes** Yes Yes Yes Yes Yes/No [#c5]_ Yes/No [#c5]_
44+
**Rollback** Yes [#c2]_ Yes Yes Yes Yes/No [#c5]_ Yes
45+
===================== ========== ===== ================ ================== ============== ==============
4446

4547
.. [#c1] Hand-crafted by the API as the device doesn't support the feature.
4648
.. [#c2] Not supported but emulated. Check caveats.
4749
.. [#c4] For merges, the diff is very simplistic. See caveats.
4850
.. [#c5] No for merges. See caveats.
51+
.. [#c6] NAPALM requires Junos OS >= 14.1 for commit-confirm functionality.
4952
5053
.. warning:: Before building a workflow to deploy configuration it is important you understand what the table above means;
5154
what are atomic changes and which devices support it, what does replacing or merging configuration mean, etc.
@@ -65,13 +68,13 @@ Other methods
6568
.. |yes| unicode:: U+02705 .. Yes
6669
.. |no| unicode:: U+0274C .. No
6770

68-
============================== ===== ===== ====== ====== =====
69-
_ EOS Junos IOS-XR NX-OS IOS
70-
============================== ===== ===== ====== ====== =====
71-
**load_template** |yes| |yes| |yes| |yes| |yes|
72-
**ping** |yes| |yes| |no| |yes| |yes|
73-
**traceroute** |yes| |yes| |yes| |yes| |yes|
74-
============================== ===== ===== ====== ====== =====
71+
============================== ===== ===== =================== ====== ====== =====
72+
_ EOS Junos IOS-XR (NETCONF) IOS-XR NX-OS IOS
73+
============================== ===== ===== =================== ====== ====== =====
74+
**load_template** |yes| |yes| |yes| |yes| |yes| |yes|
75+
**ping** |yes| |yes| |no| |no| |yes| |yes|
76+
**traceroute** |yes| |yes| |yes| |yes| |yes| |yes|
77+
============================== ===== ===== =================== ====== ====== =====
7578

7679
Available configuration templates
7780
---------------------------------
@@ -92,6 +95,7 @@ Caveats
9295
eos
9396
ios
9497
nxos
98+
iosxr_netconf
9599

96100
Optional arguments
97101
------------------
@@ -114,7 +118,7 @@ ____________________________________
114118
* :code:`alt_key_file` (ios, iosxr, nxos_ssh) - SSH host key file to use (if ``alt_host_keys`` is ``True``).
115119
* :code:`auto_probe` (junos) - A timeout in seconds, for which to probe the device. Probing determines if the device accepts remote connections. If `auto_probe` is set to ``0``, no probing will be done. (default: ``0``).
116120
* :code:`auto_rollback_on_error` (ios) - Disable automatic rollback (certain versions of IOS support configure replace, but not rollback on error) (default: ``True``).
117-
* :code:`config_lock` (iosxr, junos) - Lock the config during open() (default: ``False``).
121+
* :code:`config_lock` (iosxr_netconf, iosxr, junos) - Lock the config during open() (default: ``False``).
118122
* :code:`lock_disable` (junos) - Disable all configuration locking for management by an external system (default: ``False``).
119123
* :code:`config_private` (junos) - Configure private, no DB locking (default: ``False``).
120124
* :code:`canonical_int` (ios) - Convert operational interface's returned name to canonical name (fully expanded name) (default: ``False``).
@@ -124,21 +128,18 @@ ____________________________________
124128
* :code:`global_delay_factor` (ios, nxos_ssh) - Allow for additional delay in command execution (default: ``1``).
125129
* :code:`ignore_warning` (junos) - Allows to set `ignore_warning` when loading configuration to avoid exceptions via junos-pyez. (default: ``False``).
126130
* :code:`keepalive` (iosxr, junos) - SSH keepalive interval, in seconds (default: ``30`` seconds).
127-
* :code:`key_file` (ios, iosxr, junos, nxos_ssh) - Path to a private key file. (default: ``False``).
128-
* :code:`port` (eos, ios, iosxr, junos, nxos, nxos_ssh) - Allows you to specify a port other than the default.
131+
* :code:`key_file` (ios, iosxr_netconf, iosxr, junos, nxos_ssh) - Path to a private key file. (default: ``False``).
132+
* :code:`port` (eos, ios, iosxr_netconf, iosxr, junos, nxos, nxos_ssh) - Allows you to specify a port other than the default.
129133
* :code:`secret` (ios, nxos_ssh) - Password required to enter privileged exec (enable) (default: ``''``).
130134
* :code:`ssh_config_file` (ios, iosxr, junos, nxos_ssh) - File name of OpenSSH configuration file.
131135
* :code:`ssh_strict` (ios, iosxr, nxos_ssh) - Automatically reject unknown SSH host keys (default: ``False``, which means unknown SSH host keys will be accepted).
132136
* :code:`ssl_verify` (nxos) - Requests argument, enable the SSL certificates verification. See requests ssl-cert-verification for valide values (default: ``None`` equivalent to ``False``).
133137
* :code:`transport` (eos, ios, nxos) - Protocol to connect with (see `The transport argument`_ for more information).
134138
* :code:`use_keys` (ios, iosxr, nxos_ssh) - Paramiko argument, enable searching for discoverable private key files in ``~/.ssh/`` (default: ``False``).
135139
* :code:`eos_autoComplete` (eos) - Allows to set `autoComplete` when running commands. (default: ``None`` equivalent to ``False``)
136-
* :code:`eos_fn0039_config` (eos) - Transform old style configuration to the new
137-
style, available beginning with EOS release 4.23.0, as per FN 0039. Beware
138-
that enabling this option will change the configuration you're loading
139-
through NAPALM. Default: ``False`` (won't change your configuration
140-
commands).
141-
140+
* :code:`config_encoding` (iosxr_netconf) - Set encoding to either ``"xml"`` or ``"cli"`` for configuration load methods. (default: ``"cli"``)
141+
* :code:`eos_fn0039_config` (eos) - Transform old style configuration to the new style, available beginning with EOS release 4.23.0, as per FN 0039. Beware
142+
that enabling this option will change the configuration you're loading through NAPALM. Default: ``False`` (won't change your configuration commands).
142143
.. versionadded:: 3.0.1
143144

144145
The transport argument

docs/support/iosxr_netconf.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
IOS-XR (NETCONF)
2+
----------------
3+
4+
5+
Minimum IOS-XR OS Version
6+
~~~~~~~~~~~~~~~~~~~~~~~~~
7+
Only devices running IOS-XR 7.0 or later are supported by NAPALM and the IOS-XR NETCONF driver.
8+
9+
10+
Device management using XML Configuration
11+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12+
Using ``iosxr_netconf`` and a ``config_encoding="xml"`` for NAPALM configuration operations is entirely experimental. There is a very good chance XML configurations will not work properly and that only small subsections of the configuration will be configurable using merge operations.
13+
14+
15+
Device management using CLI Configuration
16+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17+
All configuration methods (``load_merge_candidate``, ``load_replace_candidate``, ``get_config``, ``compare_config``) support configuration encoded in XML and CLI (unstructured) format. This can be specified by using the ``config_encoding`` optional_args argument and setting it to either ``cli`` or ``xml`` (``cli`` is the default value).
18+
19+
20+
Retrieving device environment
21+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22+
In IOS-XR 64-bit devices that support an administration mode, the proper operation of ``get_environment`` requires that the ``iosxr_netconf`` driver session is authenticated against a username defined in that administration mode.

0 commit comments

Comments
 (0)