Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IOS-XR NETCONF support #1432

Merged
merged 134 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
7aac629
Add IOSXR NETCONF driver boilerplate
neelimapp Mar 2, 2020
ea346d7
Add base implementation for IOSXRNETCONFDriver class
neelimapp Mar 2, 2020
68c7b9d
Add get_interfaces implementation
neelimapp Mar 2, 2020
33e67c7
Add get_interfaces_counters implementation
neelimapp Mar 2, 2020
1291749
Add get_facts implementation
neelimapp Mar 2, 2020
16a489b
Add get_ntp_peers implementation
neelimapp Mar 2, 2020
90f6913
Add get_ntp_servers implementation
neelimapp Mar 2, 2020
043012a
Add get_ntp_stats implementation
neelimapp Mar 2, 2020
66ae28e
Add get_lldp_neighbors implementation
neelimapp Mar 2, 2020
e9910cb
Add convert to text_type
neelimapp Mar 2, 2020
b8b9d6f
Add get_bgp_neighbors implementation
neelimapp Mar 2, 2020
9d3b117
Add get_bgp_config implementation
neelimapp Mar 2, 2020
ddef1a7
Add get_bgp_neighbors_detail implementation
neelimapp Mar 2, 2020
ae981ab
Add get_mac_address_table implementation
neelimapp Mar 2, 2020
8d17d67
Add get_interfaces_ip implementation
neelimapp Mar 2, 2020
1bbcce6
Add get_snmp_information implementation
neelimapp Mar 2, 2020
f11927a
Add get_users implementation
neelimapp Mar 2, 2020
f4dd374
Add is_alive implementation
neelimapp Mar 7, 2020
c1e0767
Add get_config implementation
neelimapp Mar 16, 2020
528a352
Fix lock check during initialization
neelimapp Mar 17, 2020
3b50ef3
Add `close` implementation
neelimapp Mar 18, 2020
e0e1482
Add load_merge_candidate implementation
neelimapp Mar 19, 2020
fd8f349
Add load_replace_candidate implementation
neelimapp Mar 19, 2020
b2cfd8e
Add commit_config implementation
neelimapp Mar 19, 2020
5f1c60d
Add discard_config implementation
neelimapp Mar 19, 2020
7d6b051
Add rollback implementation
neelimapp Mar 19, 2020
186c1b8
Remove legacy PY2 compatibility
neelimapp Mar 21, 2020
6c8fb54
Fix arguement typo in _find_txt
neelimapp Mar 23, 2020
6ab868d
Fix load_replace_candidate to replace entire config
neelimapp Mar 23, 2020
bdcebff
Add compare_config implementation
neelimapp Mar 23, 2020
4899b29
Rework _find_txt implementation
neelimapp Mar 24, 2020
8f5e1db
Add get_lldp_neighbors_detail implementation
neelimapp Mar 24, 2020
5c985f4
Add get_arp_table implementation
neelimapp Mar 24, 2020
9367445
Add get_probes_config implementation
neelimapp Mar 24, 2020
8737997
Add get_probes_results implementation
neelimapp Mar 25, 2020
4a5aed3
Add get_route_to implementation
neelimapp Mar 26, 2020
e211996
Refactor session attribute
neelimapp Mar 27, 2020
5f1b89e
Fix get_route_to for an address without a mask
neelimapp Mar 28, 2020
9a01bea
Add empty counters for subinterfaces and bundles
neelimapp Apr 1, 2020
b5d08db
Remove redundant bgp neighbor key check
neelimapp Apr 1, 2020
83810dc
Add traceroute implementation
neelimapp Apr 2, 2020
7cca9de
Add support for key-based authentication
neelimapp Apr 2, 2020
463bf2b
Add get_environment implementation
neelimapp Apr 16, 2020
f6cf8fc
Add base pytest implementation for get methods
neelimapp Apr 16, 2020
dd7c0e6
Add mocked data for test_is_alive
neelimapp Apr 16, 2020
1e8f39b
Add support for temperature `Control Sensor`
neelimapp Apr 20, 2020
4ab54ec
Expand platform support for get_facts
neelimapp Apr 20, 2020
3ba4b6a
Add explicit default to _find_txt invocations
neelimapp May 8, 2020
14da8d8
Remove redundant lock checks
neelimapp May 8, 2020
e48eecd
Black cleanup
ktbyers May 11, 2020
3873dc8
Linting cleanup
ktbyers May 11, 2020
8ac425e
Add mock data to test get_facts
neelimapp May 12, 2020
921cb64
Add mock data to test get_environment
neelimapp May 12, 2020
a52fe4c
Add logging support
neelimapp May 12, 2020
48c654b
Add mock data to test get_facts & get_environment (#1210)
neelimapp May 12, 2020
a52ac3b
Add 4-byte AS support for get_bgp_config
neelimapp May 12, 2020
f3b8cb0
Fix is_enabled key in get_bgp_neighbors
neelimapp May 15, 2020
f808161
Add logging support (#1217)
neelimapp May 15, 2020
78ac162
Remove RPC reply tag in get_config
neelimapp Jun 26, 2020
72c591a
Merge pull request #1218 from neelimapp/iosxr_new2
mirceaulinic Jul 7, 2020
dc210ae
Add optional argument for config encoding
neelimapp Jul 9, 2020
531d7af
Add CLI support for load_replace_config
neelimapp Jul 9, 2020
78bc61b
Add CLI support for load_merge_config
neelimapp Jul 9, 2020
80bd94f
Add encoding support for get_config
neelimapp Jul 10, 2020
aeb994d
Add encoding support for compare_config
neelimapp Jul 10, 2020
0b86703
Linting cleanup
neelimapp Jul 10, 2020
9ac3c48
Merge pull request #1254 from neelimapp/iosxr_new2_cli
ktbyers Jul 10, 2020
1427686
Add config filter for XR-only module set
neelimapp Jul 10, 2020
ca608ff
Add config filter for XR-only module set
neelimapp Jul 10, 2020
d745b9b
Add config filter for XR-only module set
neelimapp Jul 15, 2020
435f68c
Linting cleanup
neelimapp Jul 17, 2020
ef23988
Bump black version in tox.ini to match requirements-dev.txt
111pontes Jul 29, 2020
666c3ae
Merge pull request #1256 from neelimapp/iosxr_new2_xml_XR_only
ktbyers Jul 29, 2020
99a0d34
Update constants with optimized snmp filter
neelimapp Oct 6, 2020
8920213
Fix numeric defaults in probe getters
neelimapp Oct 6, 2020
be0aa88
Rename get_environment mock data
neelimapp Oct 7, 2020
94d039c
Rename get_facts mock data
neelimapp Oct 7, 2020
d5115c7
Add mock data to test get_facts on Cisco 8000
neelimapp Oct 7, 2020
2c4c804
Add mock data to test get_arp_table
neelimapp Oct 7, 2020
0ccaaef
Add mock data to test get_bgp_config
neelimapp Oct 7, 2020
b44913d
Add mock data to test get_bgp_neighbors
neelimapp Oct 7, 2020
3c3b337
Add mock data to test get_bgp_neighbors_detail
neelimapp Oct 7, 2020
c170e5f
Add mock data to test get_interfaces
neelimapp Oct 7, 2020
a28d5cd
Add mock data to test get_interfaces_counters
neelimapp Oct 7, 2020
ea289e2
Add mock data to test get_interfaces_ip
neelimapp Oct 7, 2020
aa7d7eb
Add mock data to test get_lldp_neighbors
neelimapp Oct 7, 2020
b51c2dc
Add mock data to test get_lldp_neighbors_detail
neelimapp Oct 7, 2020
3267e5b
Add mock data to test get_mac_address_table
neelimapp Oct 7, 2020
97ca331
Add mock data to test get_ntp_peers
neelimapp Oct 7, 2020
354d4c8
Add mock data to test get_ntp_servers
neelimapp Oct 7, 2020
180cbcc
Add mock data to test get_ntp_stats
neelimapp Oct 7, 2020
56cb350
Add mock data to test get_probes_config
neelimapp Oct 7, 2020
d87fab2
Add mock data to test get_probes_results
neelimapp Oct 7, 2020
7f28a6f
Add mock data to test get_route_to
neelimapp Oct 7, 2020
7b0342f
Add mock data to test get_snmp_information
neelimapp Oct 7, 2020
c618d16
Add mock data to test get_users
neelimapp Oct 7, 2020
dbb1fce
Add mock data to test traceroute
neelimapp Oct 7, 2020
c327956
Add mock data to test get_config
neelimapp Oct 8, 2020
5643664
Fix mock data to test get_config
neelimapp Oct 8, 2020
1e21d93
Refactor naming convention for mock data files
neelimapp Oct 8, 2020
153009b
Linting cleanup
neelimapp Oct 8, 2020
e4e0720
Merge pull request #1304 from neelimapp/test-data
ktbyers Oct 8, 2020
a92ba9f
Add support for new password encryption types
neelimapp Oct 20, 2020
75d393a
Add support for sanitized arg in get_config
neelimapp Oct 20, 2020
a693df9
Add mock data to test get_config (sanitized)
neelimapp Oct 20, 2020
7aabe18
Add documentation for iosxr_netconf driver
neelimapp Oct 30, 2020
f528c58
Merge branch 'develop' into iosxr_new2
ktbyers Dec 16, 2020
006d745
Black
ktbyers Dec 16, 2020
dc53037
Fixing issues with tests; using object attribute for encoding
ktbyers Dec 17, 2020
712992a
Black
ktbyers Dec 17, 2020
27fb95c
Update black version
ktbyers Dec 17, 2020
beb7159
Fixing f-strings
ktbyers Dec 17, 2020
a3f0207
Adding robust code
neelimapp Feb 8, 2021
be82be0
Merge pull request #1370 from neelimapp/iosxr_new2
ktbyers Feb 8, 2021
60acfab
Merge branch 'develop' into iosxr_new2
ktbyers Mar 6, 2021
e602b5a
Black
ktbyers Mar 6, 2021
7fd5d87
Improving IOS-XR diff
ktbyers Apr 8, 2021
3bdb5c2
Unifying strip_config_header such that code is shared
ktbyers Apr 8, 2021
8252b8e
Merge pull request #1418 from napalm-automation/netconf_compare_config
ktbyers Apr 8, 2021
26df998
Adding ncclient as a direct dependency for IOS-XR NETCONF
ktbyers Apr 8, 2021
1cf28d9
Merge branch 'iosxr_new2' into docs
ktbyers Apr 8, 2021
a5092aa
Merge pull request #1419 from napalm-automation/ncclient_dep
ktbyers Apr 8, 2021
2395963
Merge branch 'docs' of https://github.com/neelimapp/napalm into neeli…
ktbyers Apr 8, 2021
1d0ef6f
Updating some of the docs
ktbyers Apr 8, 2021
f08d68f
Minor doc update
ktbyers Apr 8, 2021
ab3d83e
Minor doc updates
ktbyers Apr 8, 2021
fa62ff0
Merge pull request #1420 from napalm-automation/neelimapp-docs
ktbyers Apr 8, 2021
1a23ab9
Merge branch 'iosxr_new2' into test-data
ktbyers Apr 8, 2021
54ffd21
Linting issue
ktbyers Apr 8, 2021
d4a2530
Merge pull request #1307 from neelimapp/test-data
ktbyers Apr 8, 2021
2b11256
Merge branch 'develop' into iosxr_new2
ktbyers Apr 9, 2021
e0a070b
XML config is experimental
ktbyers Apr 16, 2021
0c59422
Merge branch 'iosxr_new2' of github.com:napalm-automation/napalm into…
ktbyers Apr 16, 2021
e535aee
Merge branch 'develop' into iosxr_new_repush
ktbyers Apr 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/development/triage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Driver labels
-------------

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

.. _triage-api-change-label:
Expand Down
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ You can select the driver you need by doing the following:
>>> from napalm import get_network_driver
>>> get_network_driver('eos')
<class napalm.eos.eos.EOSDriver at 0x10ebad6d0>
>>> get_network_driver('iosxr_netconf')
<class napalm.iosxr_netconf.iosxr_netconf.IOSXRNETCONFDriver at 0x10ad170f0>
>>> get_network_driver('iosxr')
<class napalm.iosxr.iosxr.IOSXRDriver at 0x10ec90050>
>>> get_network_driver('junos')
Expand Down
69 changes: 34 additions & 35 deletions docs/support/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,22 @@ General support matrix



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

.. _pyeapi: https://github.com/arista-eosplus/pyeapi
.. _junos-eznc: https://github.com/Juniper/py-junos-eznc
.. _pyIOSXR: https://github.com/fooelisa/pyiosxr
.. _pynxos: https://github.com/networktocode/pynxos
.. _netmiko: https://github.com/ktbyers/netmiko
.. _ncclient: https://github.com/ncclient/ncclient

.. [#g1] NX-API support on the Nexus 5k, 6k and 7k families was introduced in version 7.2

Expand All @@ -32,16 +33,16 @@ General support matrix
Configuration support matrix
----------------------------

===================== ========== ========== ========== ============== ==============
_ EOS Junos IOS-XR NX-OS IOS
===================== ========== ========== ========== ============== ==============
**Config Replace** Yes Yes Yes Yes Yes
**Config Merge** Yes Yes Yes Yes Yes
**Commit Confirm** Yes Yes [#c6]_ No No No
**Compare Config** Yes Yes Yes [#c1]_ Yes [#c4]_ Yes
**Atomic Changes** Yes Yes Yes Yes/No [#c5]_ Yes/No [#c5]_
**Rollback** Yes [#c2]_ Yes Yes Yes/No [#c5]_ Yes
===================== ========== ========== ========== ============== ==============
===================== ========== ===== ================ ================== ============== ==============
_ EOS Junos IOS-XR (NETCONF) IOS-XR (XML-Agent) NX-OS IOS
===================== ========== ===== ================ ================== ============== ==============
**Config. replace** Yes Yes Yes Yes Yes Yes
**Config. merge** Yes Yes Yes Yes Yes Yes
**Commit Confirm** Yes Yes No No No No
**Compare config** Yes Yes Yes Yes [#c1]_ Yes [#c4]_ Yes
**Atomic Changes** Yes Yes Yes Yes Yes/No [#c5]_ Yes/No [#c5]_
**Rollback** Yes [#c2]_ Yes Yes Yes Yes/No [#c5]_ Yes
===================== ========== ===== ================ ================== ============== ==============

.. [#c1] Hand-crafted by the API as the device doesn't support the feature.
.. [#c2] Not supported but emulated. Check caveats.
Expand All @@ -67,13 +68,13 @@ Other methods
.. |yes| unicode:: U+02705 .. Yes
.. |no| unicode:: U+0274C .. No

============================== ===== ===== ====== ====== =====
_ EOS Junos IOS-XR NX-OS IOS
============================== ===== ===== ====== ====== =====
**load_template** |yes| |yes| |yes| |yes| |yes|
**ping** |yes| |yes| |no| |yes| |yes|
**traceroute** |yes| |yes| |yes| |yes| |yes|
============================== ===== ===== ====== ====== =====
============================== ===== ===== =================== ====== ====== =====
_ EOS Junos IOS-XR (NETCONF) IOS-XR NX-OS IOS
============================== ===== ===== =================== ====== ====== =====
**load_template** |yes| |yes| |yes| |yes| |yes| |yes|
**ping** |yes| |yes| |no| |no| |yes| |yes|
**traceroute** |yes| |yes| |yes| |yes| |yes| |yes|
============================== ===== ===== =================== ====== ====== =====

Available configuration templates
---------------------------------
Expand All @@ -94,6 +95,7 @@ Caveats
eos
ios
nxos
iosxr_netconf

Optional arguments
------------------
Expand All @@ -116,7 +118,7 @@ ____________________________________
* :code:`alt_key_file` (ios, iosxr, nxos_ssh) - SSH host key file to use (if ``alt_host_keys`` is ``True``).
* :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``).
* :code:`auto_rollback_on_error` (ios) - Disable automatic rollback (certain versions of IOS support configure replace, but not rollback on error) (default: ``True``).
* :code:`config_lock` (iosxr, junos) - Lock the config during open() (default: ``False``).
* :code:`config_lock` (iosxr_netconf, iosxr, junos) - Lock the config during open() (default: ``False``).
* :code:`lock_disable` (junos) - Disable all configuration locking for management by an external system (default: ``False``).
* :code:`config_private` (junos) - Configure private, no DB locking (default: ``False``).
* :code:`canonical_int` (ios) - Convert operational interface's returned name to canonical name (fully expanded name) (default: ``False``).
Expand All @@ -126,21 +128,18 @@ ____________________________________
* :code:`global_delay_factor` (ios, nxos_ssh) - Allow for additional delay in command execution (default: ``1``).
* :code:`ignore_warning` (junos) - Allows to set `ignore_warning` when loading configuration to avoid exceptions via junos-pyez. (default: ``False``).
* :code:`keepalive` (iosxr, junos) - SSH keepalive interval, in seconds (default: ``30`` seconds).
* :code:`key_file` (ios, iosxr, junos, nxos_ssh) - Path to a private key file. (default: ``False``).
* :code:`port` (eos, ios, iosxr, junos, nxos, nxos_ssh) - Allows you to specify a port other than the default.
* :code:`key_file` (ios, iosxr_netconf, iosxr, junos, nxos_ssh) - Path to a private key file. (default: ``False``).
* :code:`port` (eos, ios, iosxr_netconf, iosxr, junos, nxos, nxos_ssh) - Allows you to specify a port other than the default.
* :code:`secret` (ios, nxos_ssh) - Password required to enter privileged exec (enable) (default: ``''``).
* :code:`ssh_config_file` (ios, iosxr, junos, nxos_ssh) - File name of OpenSSH configuration file.
* :code:`ssh_strict` (ios, iosxr, nxos_ssh) - Automatically reject unknown SSH host keys (default: ``False``, which means unknown SSH host keys will be accepted).
* :code:`ssl_verify` (nxos) - Requests argument, enable the SSL certificates verification. See requests ssl-cert-verification for valide values (default: ``None`` equivalent to ``False``).
* :code:`transport` (eos, ios, nxos) - Protocol to connect with (see `The transport argument`_ for more information).
* :code:`use_keys` (ios, iosxr, nxos_ssh) - Paramiko argument, enable searching for discoverable private key files in ``~/.ssh/`` (default: ``False``).
* :code:`eos_autoComplete` (eos) - Allows to set `autoComplete` when running commands. (default: ``None`` equivalent to ``False``)
* :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
that enabling this option will change the configuration you're loading
through NAPALM. Default: ``False`` (won't change your configuration
commands).

* :code:`config_encoding` (iosxr_netconf) - Set encoding to either ``"xml"`` or ``"cli"`` for configuration load methods. (default: ``"cli"``)
* :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
that enabling this option will change the configuration you're loading through NAPALM. Default: ``False`` (won't change your configuration commands).
.. versionadded:: 3.0.1

The transport argument
Expand Down
22 changes: 22 additions & 0 deletions docs/support/iosxr_netconf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
IOS-XR (NETCONF)
----------------


Minimum IOS-XR OS Version
~~~~~~~~~~~~~~~~~~~~~~~~~
Only devices running IOS-XR 7.0 or later are supported by NAPALM and the IOS-XR NETCONF driver.


Device management using XML Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.


Device management using CLI Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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).


Retrieving device environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
11 changes: 10 additions & 1 deletion napalm/_SUPPORTED_DRIVERS.py
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
SUPPORTED_DRIVERS = ["base", "eos", "ios", "iosxr", "junos", "nxos", "nxos_ssh"]
SUPPORTED_DRIVERS = [
"base",
"eos",
"ios",
"iosxr",
"junos",
"nxos",
"nxos_ssh",
"iosxr_netconf",
]
2 changes: 1 addition & 1 deletion napalm/base/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
r"^(snmp-server user \S+( \S+)? auth md5) \S+ (priv) \S+ (localizedkey( engineID \S+)?)\s*$": r"\1 <removed> \3 <removed> \4\5", # noqa
r"^(username .+ (password|secret) \d) .+$": r"\1 <removed>",
r"^(enable (password|secret)( level \d+)? \d) .+$": r"\1 <removed>",
r"^(\s+(?:password|secret)) (?:\d )?\S+$": r"\1 <removed>",
r"^(\s+(?:password|secret)) (?:\d{1,2} )?\S+$": r"\1 <removed>",
r"^(.*wpa-psk ascii \d) (\S+)$": r"\1 <removed>",
r"^(.*key 7) (\d.+)$": r"\1 <removed>",
r"^(tacacs-server (.+ )?key) .+$": r"\1 <removed>",
Expand Down
2 changes: 2 additions & 0 deletions napalm/base/test/getters.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ def test_get_config(self, test_case):
@wrap_test_cases
def test_get_config_filtered(self, test_case):
"""Test get_config method."""
if self.device.platform == "iosxr_netconf":
pytest.skip("This test is not implemented on {self.device.platform}")
for config in ["running", "startup", "candidate"]:
get_config = self.device.get_config(retrieve=config)

Expand Down
10 changes: 10 additions & 0 deletions napalm/iosxr/utilities.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import re


def strip_config_header(config):
"""Normalize items that should not show up in IOS-XR compare_config."""
config = re.sub(r"^Building config.*\n!! IOS.*", "", config, flags=re.M)
config = config.strip()
config = re.sub(r"^!!.*", "", config)
config = re.sub(r"end$", "", config)
return config.strip()
29 changes: 29 additions & 0 deletions napalm/iosxr_netconf/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
# Copyright 2020 CISCO. All rights reserved.
#
# The contents of this file are 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.

"""napalm.iosxr_netconf package."""

# Import stdlib
import pkg_resources

# Import local modules
from napalm.iosxr_netconf.iosxr_netconf import IOSXRNETCONFDriver # noqa

__all__ = ("IOSXRNETCONFDriver",)

try:
__version__ = pkg_resources.get_distribution("napalm-iosxr-netconf").version
except pkg_resources.DistributionNotFound:
__version__ = "Not installed"
Loading