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

Release 3.3.0 #1358

Merged
merged 185 commits into from May 5, 2021
Merged

Release 3.3.0 #1358

merged 185 commits into from May 5, 2021

Conversation

mirceaulinic
Copy link
Member

Preparing the first release candidate fro NAPALM 3.3.0.

vincentbernat and others added 30 commits September 7, 2020 21:56
`junos` was incorrectly mapped to `juniper_eos` instead of
`juniper_junos`. It shouldn't matter much as, AFAIK, `junos` is not
using Netmiko.
Fix mapping for Juniper devices with Netmiko
Due to a copy-paste probably, the code is currently looking under the
``instance_active_list``, which as the name suggests is a list of XML
trees, therefore any xpath query fails, with the following message.
Thanks to the newly added logging on the ``find_txt`` helper, the
following appeared in the logs:

```
'list' object has no attribute 'xpath'
'list' object has no attribute 'xpath'
'list' object has no attribute 'xpath'
'list' object has no attribute 'xpath'
'list' object has no attribute 'xpath'
'list' object has no attribute 'xpath'
```

This corrects this, by referencing the actual XML tree for the VRF
instead of the list of VRFs.
Look up the KeepAliveTime and HoldTime keys in the VRF tree
Co-authored-by: Richard Collins <rbcollins@gmail.com>
* initial stub out of commit confirmation methods and args

* update method args and doc strings based on PR discussion

* update base driver tests with new confirm_commit methods

* Updates to commit_confirm driver

* Updates to new naming

* Implement commit_confirm for EOS

First shot as a proof of concept.

* EOS updates for commit confirm

* Commit confirm updates

* Black

* Updates for commit confirm

Co-authored-by: Richard Collins <rbcollins@gmail.com>
Co-authored-by: Andreas Thienemann <andreas@bawue.net>
Remove Print Statement from nxos_ssh.py
Bumps [tox](https://github.com/tox-dev/tox) from 3.20.0 to 3.20.1.
- [Release notes](https://github.com/tox-dev/tox/releases)
- [Changelog](https://github.com/tox-dev/tox/blob/master/docs/changelog.rst)
- [Commits](tox-dev/tox@3.20.0...3.20.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Add wildcard for set matches on junos
Optional arguments should be declared as such using type directive according to sphinx documentation
…on_optional_parameters

Improvement/documentation optional parameters
correct collections import for python 3.3+
Adding cannonical mapping for 25GE, 50GE, 200GE and 400GE interfaces
Add possibility to mock traceroute and ping results
…lls-2.2.0

Bump coveralls from 2.1.2 to 2.2.0
Bumps [mock](https://github.com/testing-cabal/mock) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/testing-cabal/mock/releases)
- [Changelog](https://github.com/testing-cabal/mock/blob/master/CHANGELOG.rst)
- [Commits](testing-cabal/mock@4.0.2...4.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
@ktbyers ktbyers force-pushed the develop branch 2 times, most recently from fa3c534 to b2ee14f Compare April 30, 2021 20:23
ktbyers and others added 7 commits April 30, 2021 13:32
* Add IOSXR NETCONF driver boilerplate

* Add base implementation for IOSXRNETCONFDriver class

Implemented class initialization and open methods. In addition, added implementation for private lock and unlock methods. Remaining methods return NotImplementedError. Class makes use of the NETCONF implementation in the ncclient package. The open method establishes a connection using password based authentication and automatically locks the candidate datastore.

* Add get_interfaces implementation

Implement get interfaces using the operational data in Cisco-IOS-XR-pfi-im-cmd-oper YANG model. In addition, implement private _find_txt method to retrieve data leaves taking into account the data model namespace. The RPC filter and namespace strings added in constants.py.

* Add get_interfaces_counters implementation

Implement get interface counters using the operational data in Cisco-IOS-XR-pfi-im-cmd-oper YANG model. The RPC filter string is different from the filter used for get_interfaces method. Each method relies on data from different subtrees of the same operational data model.

* Add get_facts implementation

Implement get facts using the operational data in Cisco-IOS-XR-shellutil-oper, Cisco-IOS-XR-pfi-im-cmd-oper and Cisco-IOS-XR-invmgr-oper YANG models. Uses an explicit RPC string with multiple subtree filters to retrieve data from multiple data models in a single call. The RPC and namespace strings added in constants.py.

* Add get_ntp_peers implementation

Implement get NTP peers using the configuration data in Cisco-IOS-XR-ip-ntp-cfg YANG model. The RPC filter and namespace string added in constants.py.

* Add get_ntp_servers implementation

Implement get NTP servers using the configuration data in Cisco-IOS-XR-ip-ntp-cfg YANG model.

* Add get_ntp_stats implementation

Implement get NTP statistics using the operational data in Cisco-IOS-XR-ip-ntp-oper YANG model. The RPC filter and namespace string added in constants.py.

* Add get_lldp_neighbors implementation

Implement get LLDP neighbors using the operational data in Cisco-IOS-XR-ethernet-lldp-oper YANG model. The RPC filter and namespace string added in constants.py.

* Add convert to text_type

* Add get_bgp_neighbors implementation

Implement get BGP neighbors using the operational data in Cisco-IOS-XR-ipv4-bgp-oper YANG model. The method uses a helper method (get_neighbors) to gather the neighbors of the default(global) VRF first and then the neighbors of the other VRFs. All the required operational data is retrieved from the device in a single RPC call. The RPC filter and namespace string added in constants.py.

* Add get_bgp_config implementation

Implement get BGP configuration using the configuration data in Cisco-IOS-XR-ipv4-bgp-cfg YANG model. The RPC filter and namespace string added in constants.py.

* Add get_bgp_neighbors_detail implementation

Implement get BGP neighbors detail using the operational data in Cisco-IOS-XR-ipv4-bgp-oper YANG model. The method uses a helper method (get_vrf_neighbors_detail) to gather the neighbors of the default(global) VRF first and then the neighbors of the other VRFs. All the required operational data is retrieved from the device in a single RPC call.

* Add get_mac_address_table implementation

Implement get MAC address table using the operational data in Cisco-IOS-XR-l2vpn-oper YANG model. The RPC filter and namespace string added in constants.py.

* Add get_interfaces_ip implementation

Implement get IP interfaces using the operational data in Cisco-IOS-XR-ipv4-io-oper and Cisco-IOS-XR-ipv6-ma-oper YANG models. Uses an explicit RPC string with multiple subtree filters to retrieve data from multiple data models in a single call. The RPC and namespace strings added in constants.py.

* Add get_snmp_information implementation

Implement get SNMP information using the configuration data in Cisco-IOS-XR-snmp-agent-cfg YANG model. The RPC and namespace strings added in constants.py. The ipv4 and ipv6 ACL data is now included in the result. The data was missing in the implementation of the IOSXR driver.

* Add get_users implementation

Implement get users using the configuration data in Cisco-IOS-XR-aaa-lib-cfg and Cisco-IOS-XR-aaa-locald-cfg YANG models. The RPC and namespace strings added in constants.py.

* Add is_alive implementation

Return false if the connection is not instantiated or not open. Otherwise, return true.

* Add get_config implementation

Return device running and/or candidate configurations. The `full` argument ignored as `with-default` capability is not supported.

* Fix lock check during initialization

* Add `close` implementation

Close NETCONF session. Unlock candidate datastore if currently locked.

* Add load_merge_candidate implementation

Load and merge candidate configuration from a file or string. This method relies on a private method (_load_candidate_config) to read the configuration and issue an edit-config RPC with rollback-on-error error-option. If an error is detected on client or server side, a MergeConfigException is raised.

* Add load_replace_candidate implementation

Load and replace candidate configuration from a file or string. This method relies on a private method (_load_candidate_config) to read the configuration and issue an edit-config RPC with rollback-on-error error-option. If an error is detected on client or server side, a ReplaceConfigException is raised.

* Add commit_config implementation

Commit candidate configuration by issuing a NETCONF commit RPC.

* Add discard_config implementation

Discard the candidate configuration by issuing a NETCONF discard-changes RPC.

* Add rollback implementation

Roll back the last commit to the running configuration by issuing a roll-back-configuration-last RPC as defined in Cisco-IOS-XR-cfgmgr-rollback-act data model.

* Remove legacy PY2 compatibility

* Fix arguement typo in _find_txt

* Fix load_replace_candidate to replace entire config

Reimplement load replace candidate method to use copy-config RPC instead of edit-config RPC. This implementation guarantees an entire replacement of the configuration once a commit RPC is issued on the device. These changes slightly modified the load_merge_candidate implementation, but they don't alter its behaviour.

* Add compare_config implementation

Compare candidate and running datastores. The output is styled as a diff file. The XML strings for candidate and running configurations are parsed as etrees and re-encoded as strings to make the comparison more reliable.

* Rework _find_txt implementation

Improve handling of YANG-modeled data. The new implementation now differentiates between a path match (returns a string) and a non-match (returns None unless a default is specified). In case a path matches a tag without a value, an empty string is returned. While this implementation is not truly YANG-aware, it facilitates the handling of any presence containers or empty leafs.

* Add get_lldp_neighbors_detail implementation

Implement get LLDP neighbors detail using the operational data in Cisco-IOS-XR-ethernet-lldp-oper YANG model. No new RPC filter or namespace is being introduced.

* Add get_arp_table implementation

Implement get ARP table using the operational data in Cisco-IOS-XR-ipv4-arp-oper YANG model. The RPC filter and namespace string added in constants.py.

* Add get_probes_config implementation

Implement get probe configuration using the data in Cisco-IOS-XR-man-ipsla-cfg YANG model. The RPC filter and namespace string added in constants.py.

* Add get_probes_results implementation

Implement get probe results using the operational data in Cisco-IOS-XR-man-ipsla-oper YANG model. The RPC filter and namespace string added in constants.py.

* Add get_route_to implementation

Implement get route to using the operational data in Cisco-IOS-XR-ip-rib-ipv4-oper and Cisco-IOS-XR-ip-rib-ipv6-oper YANG models. The RPC filter and namespace string added in constants.py.

* Refactor session attribute

Rename 'self.netconf_ssh' as 'self.device' to make it consistent with other drivers and support pytest framework.

* Fix get_route_to for an address without a mask

Use a prefix length (mask) of zero when the method gets invoked without one. Using this default value guarantees a correct longest prefix match.

* Add empty counters for subinterfaces and bundles

Subinterfaces and bundles are now included in the interface counters dictionary. All counters for those interfaces are shown empty. Loopback interfaces are excluded from the dictionary. These changes make the result backward compatible with the `iosxr` driver.

* Remove redundant bgp neighbor key check

* Add traceroute implementation

Implement trace route using the RPC in Cisco-IOS-XR-traceroute-act YANG models. The RPC and namespace strings added in constants.py.

* Add support for key-based authentication

* Add get_environment implementation

Implement get environment using the operational data in environment monitoring, system monitoring and memory summary models. The environment monitoring data (power, fans, temperature) is retrieved from Cisco-IOS-XR-sysadmin-asr9k-envmon-ui, Cisco-IOS-XR-sysadmin-envmon-ui and Cisco-IOS-XR-sysadmin-fretta-envmon-ui YANG models. The system monitoring data (CPU) is retrieved from Cisco-IOS-XR-wdsysmon-fd-oper YANG model. The memory summary data (memory) is retrieved from Cisco-IOS-XR-nto-misc-oper YANG model. The current implementation supports ASR9000 (64 bit), NCS5500 and XRv 9000. The RPC filters and namespace strings added in constants.py.

* Add base pytest implementation for get methods

Create the child class `PatchedIOSXRNETCONFDriver` that uses a `FakeIOSXRNETCONFDevice` object as device driver. The device relies on mocked data stored in XML files. The data is returned by the device methods (dispatch, get, get_config) as objects of the `FakeRPCReply` class.

* Add mocked data for test_is_alive

File with expected results for the `is_alive` method in the patched driver.

* Add support for temperature `Control Sensor`

Read platform temperature from logical `Control Sensor` if present. This sensor provides an average of the physical temperature sensors.

* Expand platform support for get_facts

Retrieve basic attribute platforms from `Rack 0` entity for greater platform support.

* Add explicit default to _find_txt invocations

An empty string ("") is used as default to emulate the behaviour of napalm.base.helpers.find_txt. That function returns an empty string both when xml tag has no value and when xml tag doesn't exist.

* Remove redundant lock checks

* Black cleanup

* Linting cleanup

* Add mock data to test get_facts

Mock data resides in per-platform directories. Each directory includes a version.md file with the software version of the device. This file
exists for documentation purpose only.

* Add mock data to test get_environment

Mock data resides in per-platform directories. Each directory includes a version.md file with the software version of the device. This file exists for documentation purpose only.

* Add logging support

* Add mock data to test get_facts & get_environment (#1210)

* Add 4-byte AS support for get_bgp_config

* Fix is_enabled key in get_bgp_neighbors

* Add logging support (#1217)

* Remove RPC reply tag in get_config

* Add optional argument for config encoding

Define new optional argument (config_encoding) to specify the expected encoding in load_merge_config and load_replace_config. When not specified, the encoding defaults to "cli". A ValueError exception is raised if an invalid encoding is specified.

* Add CLI support for load_replace_config

Load replace config now supports both CLI and XML format based on config encoding attribute.

* Add CLI support for load_merge_config

Load merge config now supports both CLI and XML format based on config encoding attribute.

* Add encoding support for get_config

The get_config method now accepts an encoding argument that can be set to "xml" or "cli". The argument defaults to "cli". An exception is raised if an unsupported encoding value is provided.

* Add encoding support for compare_config

The compare_config method now accepts an encoding argument that can be set to "xml" or "cli". The argument defaults to "cli". An exception is raised if an unsupported encoding value is provided.

* Linting cleanup

* Add config filter for XR-only module set

Retrieval of configuration in XML format is limited to models in the XR-only module set. All the other models are filtered out. Both get_config and compare_config make use of this filtering.

* Add config filter for XR-only module set

Retrieval of configuration in XML format is limited to models in the XR-only module set. All the other models are filtered out. Both get_config and compare_config make use of this filtering. The RPC filter and namespace string added in constants.py. The models in the module set are determined using the YANG library model. If a device  doesn't support the YANG library model, no filtering is performed.

* Add config filter for XR-only module set

Retrieval of configuration in XML format is limited to models in the XR-only module set. All the other models are filtered out. Both get_config and compare_config make use of this filtering. The models in the module set are determined using the YANG library model. If a device  doesn't support the YANG library model, explicit filtering is performed.

* Linting cleanup

* Bump black version in tox.ini to match requirements-dev.txt

* Update constants with optimized snmp filter

* Fix numeric defaults in probe getters

* Rename get_environment mock data

The mock data files now uniquely identify the set of model names and model roots they use. This naming convention applies to all mock data files.

* Rename get_facts mock data

* Add mock data to test get_facts on Cisco 8000

* Add mock data to test get_arp_table

* Add mock data to test get_bgp_config

* Add mock data to test get_bgp_neighbors

* Add mock data to test get_bgp_neighbors_detail

* Add mock data to test get_interfaces

* Add mock data to test get_interfaces_counters

* Add mock data to test get_interfaces_ip

* Add mock data to test get_lldp_neighbors

* Add mock data to test get_lldp_neighbors_detail

* Add mock data to test get_mac_address_table

* Add mock data to test get_ntp_peers

* Add mock data to test get_ntp_servers

* Add mock data to test get_ntp_stats

* Add mock data to test get_probes_config

* Add mock data to test get_probes_results

* Add mock data to test get_route_to

* Add mock data to test get_snmp_information

* Add mock data to test get_users

* Add mock data to test traceroute

* Add mock data to test get_config

* Fix mock data to test get_config

* Refactor naming convention for mock data files

The mock data files now uniquely identify the set of model names and model roots they use. This naming convention applies to all mock data files. For configuration getter methods, the datastore name (running, candidate) is appended as the suffix in the mock data file name.

* Linting cleanup

* Add support for new password encryption types

Extends CISCO_SANITIZE_FILTERS to support 2-digit password encryption types. Previous regex supported only 1-digit password encryption types.

* Add support for sanitized arg in get_config

* Add mock data to test get_config (sanitized)

* Add documentation for iosxr_netconf driver

* Black

* Fixing issues with tests; using object attribute for encoding

* Black

* Update black version

* Fixing f-strings

* Adding robust code

* Black

* Improving IOS-XR diff

* Unifying strip_config_header such that code is shared

* Adding ncclient as a direct dependency for IOS-XR NETCONF

* Updating some of the docs

* Minor doc update

* Minor doc updates

* Linting issue

* XML config is experimental

Co-authored-by: Neelima Parakala <neelimaparakala23@gmail.com>
Co-authored-by: Mircea Ulinic <mirceaulinic@users.noreply.github.com>
Co-authored-by: Santiago Alvarez <saalvare@cisco.com>
Supersedes #1430 and
makes the necessary changes to make Black checks happy.
…fig-file

Upgrade to GitHub-native Dependabot
@mirceaulinic mirceaulinic changed the title Release 3.3.0rc1 Release 3.3.0 May 4, 2021
dependabot bot and others added 2 commits May 5, 2021 08:25
Bumps [black](https://github.com/psf/black) from 21.4b2 to 21.5b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>
@mirceaulinic mirceaulinic merged commit b82aebc into master May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet