15
0
forked from pool/python-napalm

- Update to 5.0.0:

* New features
    + Add format optional variable to core drivers to support get_config()
      options
    + [Junos] Add huge_tree as an optional_arg in junos to fix xml huge
      tree node
    + [Validate] Add tolerance percentage
  * Improvements and bug fixes
    + [NX-OS] Update nxos.py to expose file transfer errors
    + [Validate] Use isinstance(list) instead of types comparison
    + [Junos] Do not try to parse a "none" value and convert it to "" for
      get_ipv6_neighbors_table
    + [JUNOS] Fix call to lxml.etree.ElementBase.getparent erroneously
      using get_parent
    + [NX-OS SSH, IOS] IPv6 Regex update
    + [IOS] Make get_vlans name whitespace aware
    + [NX-OS] Fix get_bgp_neighbor when neighbor is admin shut
    + [JUNOS] get_bgp_config() - ValueError: Can't convert with callable None
    + [IOS] get_bgp_neighbors same IP different VRF
    + [NX-OS] Handle non standard output for PSU's in get_environment
    + [IOS-XR] Use LastStateTransitionTime to populate last_flapped for
      get_interfaces() in IOS-XR
    + [Junos] Fix Can't convert with callable None
- Refreshed python-napalm-no-mock.patch
- Removed patches, included upstream: 
  * napalm-gh-pr1796-xmlgetparent.patch
  * remove-future-requirement.patch
- Add patch support-python-313.patch:
  * Use vendored telnetlib provided by netmiko

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-napalm?expand=0&rev=34
This commit is contained in:
2024-12-10 01:27:43 +00:00
committed by Git OBS Bridge
commit 6cd1f46004
10 changed files with 842 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

3
napalm-4.1.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3ee779fa3949bc34efa1a32ae7b81074bc916c4b9b5a9c8bcd289660bddee6ef
size 1565210

3
napalm-5.0.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b47dca6fb71f511fed03945d5c5abf9338024947e375b218bae7d50ed6175af7
size 1567474

View File

@@ -0,0 +1,25 @@
From adb91dffa829127319903fee985a02d127fe13fc Mon Sep 17 00:00:00 2001
From: Chris Moore <cmoore79@depaul.edu>
Date: Fri, 11 Nov 2022 15:46:47 -0600
Subject: [PATCH] fix call to lxml.etree._ElementTree.getparent
lxml.etree._ElementTree.get_parent() doesn't exist - it's getparent() - https://lxml.de/apidoc/lxml.etree.html#lxml.etree.ElementBase.getparent
This enables fetching junos command output as XML through `<command> | display xml`
---
napalm/junos/junos.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/napalm/junos/junos.py b/napalm/junos/junos.py
index 8d56b0fbc..81c83a6c4 100644
--- a/napalm/junos/junos.py
+++ b/napalm/junos/junos.py
@@ -1136,7 +1136,7 @@ def _process_pipe(cmd, txt):
)
raw_txt = self.device.cli(safe_command, warning=False, format=encoding)
if isinstance(raw_txt, etree._Element):
- raw_txt = etree.tostring(raw_txt.get_parent()).decode()
+ raw_txt = etree.tostring(raw_txt.getparent()).decode()
cli_output[str(command)] = raw_txt
else:
cli_output[str(command)] = str(_process_pipe(command, raw_txt))

View File

@@ -0,0 +1,73 @@
From 9dd413d6254f2dc034903736b65b1853b2163e7d Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Tue, 10 Dec 2024 12:07:37 +1100
Subject: [PATCH] Remove external mock dependency
Since the minimum version of Python we support contains mock in the
standard library, we should switch to it and remove one external
dependency.
---
requirements-dev.txt | 1 -
test/eos/test_heredoc.py | 2 +-
test/nxos/test_getters.py | 3 ++-
test/nxos_ssh/test_getters.py | 3 ++-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/requirements-dev.txt b/requirements-dev.txt
index 0a766587e..af4394c46 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -7,7 +7,6 @@ pytest-cov==5.0.0
pytest-json-report==1.5.0
pyflakes==3.2.0
pylama==8.4.1
-mock==5.1.0
mypy==1.10.0
types-PyYAML==6.0.12.20240311
types-requests==2.32.0.20240521
diff --git a/test/eos/test_heredoc.py b/test/eos/test_heredoc.py
index cf5d891fa..418592771 100644
--- a/test/eos/test_heredoc.py
+++ b/test/eos/test_heredoc.py
@@ -1,4 +1,4 @@
-import mock
+from unittest import mock
import pytest
from textwrap import dedent
diff --git a/test/nxos/test_getters.py b/test/nxos/test_getters.py
index 3baa5c4b2..3436051f9 100644
--- a/test/nxos/test_getters.py
+++ b/test/nxos/test_getters.py
@@ -1,11 +1,12 @@
"""Tests for getters."""
+from unittest.mock import patch
+
from napalm.base.test.getters import BaseTestGetters, wrap_test_cases
from napalm.base.test import helpers
from napalm.base import models
import pytest
-from mock import patch
def mock_time():
diff --git a/test/nxos_ssh/test_getters.py b/test/nxos_ssh/test_getters.py
index 3baa5c4b2..3436051f9 100644
--- a/test/nxos_ssh/test_getters.py
+++ b/test/nxos_ssh/test_getters.py
@@ -1,11 +1,12 @@
"""Tests for getters."""
+from unittest.mock import patch
+
from napalm.base.test.getters import BaseTestGetters, wrap_test_cases
from napalm.base.test import helpers
from napalm.base import models
import pytest
-from mock import patch
def mock_time():

446
python-napalm.changes Normal file
View File

@@ -0,0 +1,446 @@
-------------------------------------------------------------------
Tue Dec 10 01:23:56 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Update to 5.0.0:
* New features
+ Add format optional variable to core drivers to support get_config()
options
+ [Junos] Add huge_tree as an optional_arg in junos to fix xml huge
tree node
+ [Validate] Add tolerance percentage
* Improvements and bug fixes
+ [NX-OS] Update nxos.py to expose file transfer errors
+ [Validate] Use isinstance(list) instead of types comparison
+ [Junos] Do not try to parse a "none" value and convert it to "" for
get_ipv6_neighbors_table
+ [JUNOS] Fix call to lxml.etree.ElementBase.getparent erroneously
using get_parent
+ [NX-OS SSH, IOS] IPv6 Regex update
+ [IOS] Make get_vlans name whitespace aware
+ [NX-OS] Fix get_bgp_neighbor when neighbor is admin shut
+ [JUNOS] get_bgp_config() - ValueError: Can't convert with callable None
+ [IOS] get_bgp_neighbors same IP different VRF
+ [NX-OS] Handle non standard output for PSU's in get_environment
+ [IOS-XR] Use LastStateTransitionTime to populate last_flapped for
get_interfaces() in IOS-XR
+ [Junos] Fix Can't convert with callable None
- Refreshed python-napalm-no-mock.patch
- Removed patches, included upstream:
* napalm-gh-pr1796-xmlgetparent.patch
* remove-future-requirement.patch
- Add patch support-python-313.patch:
* Use vendored telnetlib provided by netmiko
-------------------------------------------------------------------
Wed Sep 6 02:57:22 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch remove-future-requirement.patch, remove requirement of
future module.
- Switch to pyproject macros.
- Stop using greedy globs in %files.
-------------------------------------------------------------------
Wed Aug 23 08:11:59 UTC 2023 - Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
- Update to 4.1.0
Improvements
============
Improve get_bgp_config behavior across platforms.
EOS and Salt add optional_arg force_cfg_session_invalid that allows the config session to be invalidated on failure.
Improve EOS VRF parsing
Bug and doc fixes
=================
Minor doc fixes
CI-CD fixes
Properly close Netmiko SSH connections for EOS-SSH
Improve EOS get_bgp_neighbors()
Increase default commit_config timeout on IOS/IOS-XE
NX-OS pull full configuration for merge operation diff
Improve NX-OS SSH Netmiko behavior (for Netmiko V4)
- Add pending upstream patch to resolve an exception while reading XML output from Junos
napalm-gh-pr1796-xmlgetparent.patch: https://github.com/napalm-automation/napalm/pull/1796
-------------------------------------------------------------------
Mon Jan 2 12:53:17 UTC 2023 - Markéta Machová <mmachova@suse.com>
- Add missing requirements
-------------------------------------------------------------------
Tue Oct 25 07:19:55 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Remove empty netmiko-4-support.patch
-------------------------------------------------------------------
Fri Oct 21 11:13:13 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Update to 4.0.0
Type Hinting
============
- After months of work, @Kircheneer added type hinting support in #1412 and
#1476.
New features
============
- Add Commit-Confirm support for Cisco IOS #1691
- New encoding argument added to the cli method to return the output of
operational / show commands in the desired format. Currently supported on
Junos and EOS. #1637 & #1663
- Added ttp_parse helper function to codebase #1563
- Replaced ciscoconfparse with netutils #1565
- New SSH transport available for Arista EOS - thanks @thomasbridge74 #1502
Improvements
============
- Adds mac and ip checks for getters #1560
- The uptime field in the get_facts return is now float type: #1651
- [NX-OS] Improve compare_config for NXOS partial merging #1567
- [EOS] support arbitrary transport class #1643 & #1647
- [EOS] move config lock check to _load_config #1642
- [EOS] Handle modern memory output from Arista EOS 4.27+ #1673
- [IOS-XR] Improving get_facts behavior to handle XML changes in newer OS
versions #1667
- [Junos] make sure we don't duplicate LLDP neighbor entries #1640
Bug fixes
=========
- [Junos] find for system uptime element #1675
- [IOS-XR] get_lldp_neighbor_details does not support 'N/A' capabilities
#1681
- [IOS-XR] get_lldp_neighbor_details add alternative lldp local interface key
#1682
- [NX-OS] get_interfaces fix description on SVI interfaces #1571
- [IOS] get_vlans does not return all interfaces if they wrap around in the
config #1569
- [Junos] Fix #1549: Check peer admin status from the BGP options #1566
- [EOS] get_bgp_neighbors_detail only returns back a single peer for a
certain EOS platform #1573
- Update to 3.4.1
* Pinning to junos-eznc>=2.6.3
-------------------------------------------------------------------
Fri Aug 5 04:58:33 UTC 2022 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch netmiko-4-support.patch:
* Support netmiko >= 4
* As a consequence, bump {Build,}Requires on netmiko to >= 4.
- Remove unneeded BuildRequires on mock
-------------------------------------------------------------------
Thu Mar 24 12:42:56 UTC 2022 - pgajdos@suse.com
- version update to 3.4.0
Junos
Junos discard_config on error fix #1448
Junos LLDP improvements #1470
Junos pass self.ignore_warning to diff call in compare_config() #1480
NX-OS
Improve NX-API error messages #1461
NX-OS disable SSL InsecureRequestWarning if ssl_verify is False #1510
NX-OS unknown interface MTU and unknown speed as -1 #1511
NX-OS improve JSON handling in newer NX-OS versions #1490
IOS
IOS allow BGP configuration with no explicit AFI #1477
Escape vlan_name on IOS before building regex string #1546
Handle get_network_instances for IOS devices that do not support show vrf detail #1547
EOS
EOS fix get_bgp_config mismatch between neighbors and peer-group #1503
IOS-XR
Pass IOS-XR NETCONF optional_args to ncclient connect #1535
General
Bandwidth parameter returned as a float
Pin Netmiko to require Netmiko version 3.3.X or 3.4.X
- added patches
fix https://github.com/napalm-automation/napalm/issues/1594
+ python-napalm-no-mock.patch
-------------------------------------------------------------------
Tue Jan 11 21:55:43 UTC 2022 - Ben Greiner <code@bnavigator.de>
- remove selectors2 test requirement: It's unmaintained and pulled
in by ncclient only if necessary, i.e. on python <= 3.4 (!), but
nowhere declared or used by napalm itself.
-------------------------------------------------------------------
Wed Oct 13 12:42:18 UTC 2021 - ecsos <ecsos@opensuse.org>
- Fix build error for Leap 15.3
- Add Missing python-lxml.
- Add missing python-typing_extensions.
-------------------------------------------------------------------
Fri Aug 20 09:38:29 UTC 2021 - Martin Hauke <mardnh@gmx.de>
- Update to version 3.3.1
* [IOS-XR] Fix #1330 (get_bgp_neighbors_detail: flap_count
return a negative value).
* [IOS] Fix #1387 (get_network_instances fails KeyError when
deleting item from interfaces).
* [Junos] Fix bgp flap_count issue for iosxr_netconf.
* [Junos] Change the function cli when result is xml object.
* [EOS, IOS, Junos, NXOS] Add source_interface argument to ping.
- Update to version 3.3.0
New Features
* [Junos] Add get_vlans for Junos.
* [Junos] Added Support for Logical Interfaces Counters.
* [Junos] Use aply-groups inheritance on get-configuration RPC
calls.
* [Core] Adding cannonical mapping for 25GE, 50GE, 200GE and
400GE interfaces.
Bug Fixes
* [EOS] Fix for BGP description not found by get_bgp_neighbors
in some EOS versions.
* [EOS] Set next hop to something valid for vxlan routes.
* [EOS] Fix naplam.get_route_to() not working on EOS:failed to
detect a valid IP address from u''.
* [IOS-XR] XR 7+: get_lldp_neighbors_detail query only the
NodeTable.
* [IOS-XR] Resolve #1181 (IOS-XR get_environment() throws an
error in 6.3.2 on NCS5501) and reduce the get_facts heavy
workload.
* [IOS-XR] Look up the KeepAliveTime and HoldTime keys in the
VRF tree.
* [Junos] Fix sanitized bug for Junos.
* [Junos] Multiple next-hop self config stanzas generate a list.
* [Junos] Add wildcard for set matches on junos.
* [Junos] Fix mapping for Juniper devices with Netmiko.
* [IOS] Handle control plane interface.
* [IOS] Set minimum ttl to zero to fix issue.
* [NX-OS] Cast uptime values to int before processing.
-------------------------------------------------------------------
Thu Sep 3 18:55:26 UTC 2020 - Martin Hauke <mardnh@gmx.de>
- Update to version 3.2.0
New features
* [EOS] Add get_vlans getter.
* [NX-OS] Feature/nxos ssh get_interfaces_counters.
Bug fixes and behaviour changes
* [IOS] get_network_instances fixes, see #1095 for more details.
* [IOS-XR] get_route_to fix pyIOSXR.exceptions.XMLCLIError for
some versions.
* [EOS] Fix get_arp_table for static ARP records.
* [EOS] Add EOS-4.23+ translation for show environment temperature.
* [IOS] Update get_probe code to make it work it IOS XE 16.12.x.
-------------------------------------------------------------------
Mon Jul 27 18:36:06 UTC 2020 - Martin Hauke <mardnh@gmx.de>
- Update to version 3.1.0
Core changes
* Fix: force_no_enable enabled on ios and nx only
* If you maintain a thrid-party driver using Netmiko for the
underlying layer, but that doesn't make use of the enable
features typically found on IOS-like devices, it is
recommended to pin to this NAPALM version, so it won't break
compatibility.
* lxml text retrieval (find_txt) shouldn't fail if no text
element available
Driver changes
* [NX-OS] Initial version for nxos_ssh get_optics
* [NX-OS] Fixed get_bgp_neighbors and asdot notation on NX-OS
* [Junos] Fix "KeyError in get_environment() on Juniper MX10k3
with Junos 19.2R1.8 by making PEM naming consistent
* [IOS] Fix get_optics metric
* [IOS] Allow username detection on older Cisco ios versions
-------------------------------------------------------------------
Thu May 21 10:56:30 UTC 2020 - Petr Gajdos <pgajdos@suse.com>
- %python3_only -> %python_alternative
-------------------------------------------------------------------
Fri May 15 10:36:31 UTC 2020 - Martin Hauke <mardnh@gmx.de>
- Update to version 3.0.1
* [Junos] close configuration in case configure_private is set
to avoid configure session to stay forever
* [IOS] get_interfaces_counters broken with Managment Interface
* [IOS] get_optics does not work on VSS setup
* [IOS] get_optics broken if input value is N/A
* [NXOS] Fix cmd_verify and null character
-------------------------------------------------------------------
Wed May 6 15:38:12 UTC 2020 - Martin Hauke <mardnh@gmx.de>
- Update to version 3.0.0
Changes:
* Integrated nxapi_plumbing and pyIOSXR into NAPALM.
* [NXOS] If the command returns a null value then
json.loads(None) throws an exception.
* [NXOS] For Vlan interfaces nxos driver, the state is not
correctly defined (related to json output).
* [IOS] Return empty dictionary if BGP not running.
* Fix Nornir + NAPALM threading issue.
* [IOS, NXOS] get-vlans() getter implementation.
* [IOS] Fix traceroute output parsing in ios.
* [NXOS] firmware less than 7 does not support json in cli
* Updated support for TwoGigabit & TwentyFiveGig interfaces
to canonical_map.py
* [NXOS]: Prevent nxos.get_interfaces_ip from failing if no
ipv6 support.
* [Junos] Added auto_probe optional argument.
* [NXOS] Fix exception when trying to get environmental data
from certain Nexus devices.
* [IOS] Fix fix vrf detection when no vrf is defined.
* [IOS-XR} No silent pass of errors in base.helpers & logging.
* [IOS-XR] Add support for XML namespace prefixes in find_txt.
* [NXOS] Fix get_vlans() method where no interfaces in VLAN.
* [IOS] Added ``force_no_enable` optional argument.
* [NXOS] Use Kickstart version to determine NXOS version.
* [NXOS] Add nxos_ssh support for force_no_enable.
* [EOS] Fix #1153: Strip double quotation on LLDP remote port.
* [IOS] Fix typo in the traceoute method.
* add a few less used canonical mappings.
* [IOS] Fix show interfaces summary for 10/40/100 Gig Interfaces
* [IOS] Update to handle Cisco ISR mac address table with
multiple EHWIC modules installed.
* [Junos] Add support for configure private in Junos.
* add range for validate.
* [IOS] Fix get_bgp_neighbors_detail IOS-XE.
* [EOS] Cast upDownTime BGP neighbor field to float.
* All the core platforms: Filter unneeded header configuration
lines get_config.
* [Junos] SRX cluster devices stack RPC replies under
multi-routing-engine-results.
* All the core platforms: Implement get_config sanitized.
- Drop (Build)Requres for
* python-nxapi-plumbing
* python-pyIOSXR
since both are now included in napalm
-------------------------------------------------------------------
Mon Mar 30 11:49:54 UTC 2020 - pgajdos@suse.com
- version update to 2.5.0
* This is the last release supporting Python 2. Going forward, we will only support Python 3.6+
* namespace fix for napalm cli (#950)
* [EOS] Fix broken get_bgp_neighbors when 6PE configured on eos (#945)
* [NXOS] If parent_table in nxos is None call exception (#939)
* [Junos] Remove extensive argument from junos_iface_table (#929)
* MTU support for get_interfaces (#940)
* [EOS] When asPathType is Internal (IBGP), as_path is empty and the remote-as is the local_as (#1064)
* [IOS] support n9k ipv6 ints for interfaces_ip getter (#969)
* [IOS] support catalyst vss for mac_address getter (#968)
* [IOS] Raise exception if BGP neighbor info requested and BGP not running (#970)
* [NXOS] Implement nxos_ssh get_environment (#973)
* Better handling of connection closing upon exceptions in enter (#994)
* [NXOS] address single and multiple v6 address on n9k (#997)
* [NXOS] Fix nxos and nxos_ssh hostname change handling (#999)
* added option to run show run all (#1029)
* [Junos] add optional arg for DB config selection (#1035)
* [Junos] Fixed "Wrong interface information for Junos virtual-switch w/ bridge domains using get_network_instances" (#1032)
* [EOS] Implemented lock_disable for EOS based on Junos. (#1042)
* [NXOS] Work around NXAPI double quoting (#1048)
* [NXOS] napalm.nxos.traceroute - VRF traces and handle AS in hops (#989)
* [IOS] Fix extra line in show ip int brief on IOS (#986)
* [NXOS] Expand nxos commit merge rollback error (#860)
* [IOS] add support for VRF for get_arp_table func (#937)
* [IOS] get_bgp_neighbors vrf and safi aware (#768)
* [IOS] Check if temperature sensor on Cisco device is not supported (#1055)
* [IOS] Fixes get_environment memory collection on ios-xe devices (#1053)
* [IOS] get_route_to implementation for IOS (#750)
-------------------------------------------------------------------
Mon Oct 7 18:55:30 UTC 2019 - Martin Hauke <mardnh@gmx.de>
- Use github source URL (the pypi tarball does not contain tests)
- Add all required packages to run the testsuite BuildRequires
- Run testsuite
- Use %license macro
-------------------------------------------------------------------
Wed Mar 6 13:33:51 UTC 2019 - Daniel Molkentin <daniel.molkentin@suse.com>
- Initial checkin
-------------------------------------------------------------------
Tue Dec 11 13:33:04 UTC 2018 - Daniel Molkentin <daniel.molkentin@suse.com>
- Bump to 2.3.3
* Add a tutorial to use Napalm mock driver
* Create hierarch of directories to search for textfsm templates
* Junos fix is_enabled in logical interface
* Delete the ip validation of the destination of get_route_to in Junos
* support added for LLDP
* Fix ResourceWarning: unclosed files in base/helpers.py
* Update get_environment defaults if keys are missing
* nxos_ssh Update sh int regexp for 7.3.3.N1
* Raise exception instead of returning string in get_route_to
* Fix bugs with IOS ping method
* Fix the use of deprecated inspect.getargspec() for inspect.getfullarg
* QFX5100-48S-6Q to use rpc_call_without_information
* Convert over to safe form of YAML load
* Fix inspect in consistent way and use py23_compat
* Add NAPALM Dockerfile
* EOS BGP Description not getting retrieved
* Updating optional args documentation
* Fix Community Drivers link in Docs
- Includes 2.3.2
* commit_config with comment (#701)
* NXOS_SSH - fix crash issue in get_bgp_neighbors() (#678)
* Fixes #695 - inconsistent use of domain name in LLDP (#698)
* Fix bug with get_interfaces_ip with multiple ipv6 addrs on interface
* Fix #703 (#704) / Fixes PIP10 compatibility issues
* updated README.md since cl_napalm_test has been deprecated (#702)
* Remove duplicated keys in dict (#712)
* Creating generic way in napalm to create and close a netmiko connection
* Fix ipv6 test for nxos which causes RTD to fail (#720)
* Dictionary literal (#721)
* Add test for sphinx documentation (#719)
* raise napalm ErrorLock instead of jnpr ErrorLock (#707)
* Fix garbled docstrings in RTD and enable strict checking for Sphinx
* Updated fix for Catalyst 6500 reporting VLAN as N/A (#725)
* Fixing deprecated use of e.message (#726)
* Replace jtextfsm with textfsm (#731)
* Fix #736 (get_route_to bgp confed) (#737)
* IOS: get_bgp_neighbor_detail (#727)
* Implement get_ntp_peers on Cisco IOS (#752)
* The EX4300-48P has issues with LLDP information tags (#758)
* Fix issue with LLDP neighbors when remote device lacks system
* Fix #659 (#761)
* Freeze requirements-dev.txt to specific versions, fixes#780
* Fix Travis and PY34 Tox issue (#782)
* junos: support edit/top keywords in set based configs (#760)
* Allow bangs in EOS banner (#738)
- Includes 2.3.1
* Remove multiple entries for netmiko (#617)
* Fixes NX-OS string change in show diff rollback-patch output (#619)
* Require to upgrade setuptools
* Modify NX-OS to properly save config to startup-config on commit_conf
* Fixing NX-OS rollback issue (#626)
* Junos fix next-hop self in get_bgp_config() (#620)
* IOS-XR: return the is_alive flag for the SSH channel (#623)
* Fix get_interfaces_ip for non ipv6 devices (#627)
* Fixes for CAM and ARP parsing issues in nxos_ssh.py (#634)
* Minor improvement to get_arp processing on NXOS SSH (#639)
* Don't hide relevant import errors (#635)
* Update index.rst (#650)
* improved exceptions - added new base exception (#649) …
* Fixes #640 junos ConnectionException (#648)
* FIXES #653 additional error message on failed replace (#654)
* NX-OS ping implementation using more shared common code (#642)
* Fix get_mac_table on IOS when there are routed ports
* Updating junos.py to support PTX platform (#665)
* Minor doc changes for NX-OS and IOS (#669)
* Unify netmiko argument processing across napalm drivers (#673)
* Make nxos_facts behavior more consistent between NX-API and SSH (#674)
* Update get_interfaces_ip to deal with unnumbered interfaces (#632)
* Fix issue about N9K with vxlan (#676)
* Fix setup.py issue when using pip 10. (#692)
* Add virtualbox provider to the docs (#679)
* Lldp neighbors detail bugfix (#675)
* Add StackStorm integrations to README (#683)
* Track BGP state to report is_up (#684)
-------------------------------------------------------------------
Fri Feb 9 21:53:12 UTC 2018 - daniel.molkentin@suse.com
- Initial checkin

128
python-napalm.spec Normal file
View File

@@ -0,0 +1,128 @@
#
# spec file for package python-napalm
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: python-napalm
Version: 5.0.0
Release: 0
Summary: Network Automation and Programmability Abstraction Layer
License: Apache-2.0
URL: https://github.com/napalm-automation/napalm
Source: https://github.com/napalm-automation/napalm/archive/%{version}.tar.gz#/napalm-%{version}.tar.gz
# PATCH-FIX-UPSTREAM gh#napalm-automation/napalm#2155
Patch0: python-napalm-no-mock.patch
# PATCH-FIX-UPSTREAM gh#napalm-automation/napalm#2137
Patch1: support-python-313.patch
BuildRequires: %{python_module base >= 3.9}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Jinja2
Requires: python-PyYAML
Requires: python-cffi >= 1.11.3
Requires: python-junos-eznc >= 2.6.3
Requires: python-lxml >= 4.3.0
Requires: python-ncclient
Requires: python-netaddr
Requires: python-netmiko >= 4.4.0
Requires: python-netutils >= 1.0.0
Requires: python-paramiko >= 2.6.0
Requires: python-pyeapi >= 0.8.2
Requires: python-requests >= 2.7.0
Requires: python-scp
Requires: python-setuptools >= 38.4.0
Requires: python-textfsm
Requires: python-ttp
Requires: python-ttp-templates
Requires: python-typing_extensions
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module Jinja2}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module cffi >= 1.11.3}
BuildRequires: %{python_module ddt}
BuildRequires: %{python_module junos-eznc >= 2.6.3}
BuildRequires: %{python_module lxml >= 4.3.0}
BuildRequires: %{python_module ncclient}
BuildRequires: %{python_module netaddr}
BuildRequires: %{python_module netmiko >= 4.4.0}
BuildRequires: %{python_module netutils >= 1.0.0}
BuildRequires: %{python_module paramiko >= 2.6.0}
BuildRequires: %{python_module pyeapi >= 0.8.2}
BuildRequires: %{python_module pytest >= 5.4.3}
BuildRequires: %{python_module requests >= 2.7.0}
BuildRequires: %{python_module scp}
BuildRequires: %{python_module setuptools >= 38.4.0}
BuildRequires: %{python_module textfsm}
BuildRequires: %{python_module ttp-templates}
BuildRequires: %{python_module ttp}
BuildRequires: %{python_module typing_extensions}
# /SECTION
%python_subpackages
%description
NAPALM is a Python library that implements a set of functions to
interact with different router vendor devices using a unified API.
%prep
%autosetup -p1 -n napalm-%{version}
sed -i '1{/env python/d}' napalm/pyIOSXR/*.py
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/napalm
%python_clone -a %{buildroot}%{_bindir}/cl_napalm_validate
%python_clone -a %{buildroot}%{_bindir}/cl_napalm_test
%python_clone -a %{buildroot}%{_bindir}/cl_napalm_configure
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# FIXME: JunOS related unit tests are know to be broken with junos-eznc-2.3.0.
# Do not run those for now. https://github.com/napalm-automation/napalm/issues/1060
rm -Rf test/junos/
%pytest
%post
%python_install_alternative napalm
%python_install_alternative cl_napalm_validate
%python_install_alternative cl_napalm_test
%python_install_alternative cl_napalm_configure
%postun
%python_uninstall_alternative napalm
%python_uninstall_alternative cl_napalm_validate
%python_uninstall_alternative cl_napalm_test
%python_uninstall_alternative cl_napalm_configure
%files %{python_files}
%license LICENSE
%doc README.md
%python_alternative %{_bindir}/cl_napalm_configure
%python_alternative %{_bindir}/cl_napalm_test
%python_alternative %{_bindir}/cl_napalm_validate
%python_alternative %{_bindir}/napalm
%{python_sitelib}/napalm
%{python_sitelib}/napalm-%{version}.dist-info
%changelog

View File

@@ -0,0 +1,23 @@
From e384ae2dd6a2e157788f325f3e4fdf92349daec5 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Wed, 6 Sep 2023 12:52:41 +1000
Subject: [PATCH] Remove future requirement
Now that we support Python >= 3.7, we can remove the requirement on
the future module, which appears to be unused.
---
requirements.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/requirements.txt b/requirements.txt
index 57ecd72eb..3359b30a6 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,7 +2,6 @@ setuptools>=38.4.0
cffi>=1.11.3
paramiko>=2.6.0
requests>=2.7.0
-future
textfsm
jinja2
netaddr

117
support-python-313.patch Normal file
View File

@@ -0,0 +1,117 @@
From eca5aaecbd05305dda4b28ae4fbbcf40332aa909 Mon Sep 17 00:00:00 2001
From: Kirk Byers <ktbyers@twb-tech.com>
Date: Fri, 2 Aug 2024 10:53:18 -0700
Subject: [PATCH 1/9] Add support for PY3.13; use vendored version of telnetlib
---
.github/workflows/commit.yaml | 2 +-
napalm/ios/ios.py | 2 +-
requirements.txt | 2 +-
setup.py | 1 +
4 files changed, 4 insertions(+), 3 deletions(-)
Index: napalm-5.0.0/.github/workflows/commit.yaml
===================================================================
--- napalm-5.0.0.orig/.github/workflows/commit.yaml
+++ napalm-5.0.0/.github/workflows/commit.yaml
@@ -10,7 +10,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
- python-version: [3.8, 3.9, 3.10.9, 3.11, 3.12.0]
+ python-version: ["3.9", "3.10.9", "3.11", "3.12", "3.13"]
steps:
- name: Checkout repository
Index: napalm-5.0.0/napalm/ios/ios.py
===================================================================
--- napalm-5.0.0.orig/napalm/ios/ios.py
+++ napalm-5.0.0/napalm/ios/ios.py
@@ -19,7 +19,7 @@ import ipaddress
import os
import re
import socket
-import telnetlib
+from netmiko._telnetlib import telnetlib
import tempfile
import uuid
from collections import defaultdict
Index: napalm-5.0.0/requirements.txt
===================================================================
--- napalm-5.0.0.orig/requirements.txt
+++ napalm-5.0.0/requirements.txt
@@ -7,7 +7,7 @@ jinja2
netaddr
pyYAML
pyeapi>=1.0.2
-netmiko>=4.1.0
+netmiko>=4.4.0
junos-eznc>=2.7.0
scp
lxml>=4.3.0
Index: napalm-5.0.0/setup.py
===================================================================
--- napalm-5.0.0.orig/setup.py
+++ napalm-5.0.0/setup.py
@@ -19,19 +19,17 @@ setup(
author="David Barroso, Kirk Byers, Mircea Ulinic",
author_email="dbarrosop@dravetech.com, ping@mirceaulinic.net, ktbyers@twb-tech.com",
description="Network Automation and Programmability Abstraction Layer with Multivendor support",
- license="Apache 2.0",
+ license="Apache-2.0",
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=[
"Topic :: Utilities",
- "License :: OSI Approved :: Apache Software License",
- "Programming Language :: Python",
- "Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.8",
+ "License :: OSI Approved :: Apache Software License 2.0 (Apache-2.0)",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
+ "Programming Language :: Python :: 3.13",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
],
Index: napalm-5.0.0/README.md
===================================================================
--- napalm-5.0.0.orig/README.md
+++ napalm-5.0.0/README.md
@@ -31,15 +31,15 @@ Install
pip install napalm
```
+*Note*: Beginning with release 5.1.0 and later, NAPALM offers support for
+Python 3.9+ only.
+
*Note*: Beginning with release 5.0.0 and later, NAPALM offers support for
Python 3.8+ only.
*Note*: Beginning with release 4.0.0 and later, NAPALM offers support for
Python 3.7+ only.
-*Note*: Beginning with release 3.0.0 and later, NAPALM offers support for
-Python 3.6+ only.
-
Upgrading
=========
Index: napalm-5.0.0/requirements-coveralls.txt
===================================================================
--- /dev/null
+++ napalm-5.0.0/requirements-coveralls.txt
@@ -0,0 +1 @@
+coveralls==4.0.1
Index: napalm-5.0.0/requirements-dev.txt
===================================================================
--- napalm-5.0.0.orig/requirements-dev.txt
+++ napalm-5.0.0/requirements-dev.txt
@@ -1,5 +1,4 @@
black==24.3.0
-coveralls==3.3.1
ddt==1.7.2
flake8-import-order==0.18.2
pytest==7.3.1