diff --git a/napalm-4.1.0.tar.gz b/napalm-4.1.0.tar.gz deleted file mode 100644 index ddc1eec..0000000 --- a/napalm-4.1.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3ee779fa3949bc34efa1a32ae7b81074bc916c4b9b5a9c8bcd289660bddee6ef -size 1565210 diff --git a/napalm-5.0.0.tar.gz b/napalm-5.0.0.tar.gz new file mode 100644 index 0000000..24ca3e7 --- /dev/null +++ b/napalm-5.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b47dca6fb71f511fed03945d5c5abf9338024947e375b218bae7d50ed6175af7 +size 1567474 diff --git a/napalm-gh-pr1796-xmlgetparent.patch b/napalm-gh-pr1796-xmlgetparent.patch deleted file mode 100644 index 3e5ece8..0000000 --- a/napalm-gh-pr1796-xmlgetparent.patch +++ /dev/null @@ -1,25 +0,0 @@ -From adb91dffa829127319903fee985a02d127fe13fc Mon Sep 17 00:00:00 2001 -From: Chris Moore -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 ` | 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)) diff --git a/python-napalm-no-mock.patch b/python-napalm-no-mock.patch index 4020fc2..4bb29ee 100644 --- a/python-napalm-no-mock.patch +++ b/python-napalm-no-mock.patch @@ -1,36 +1,73 @@ -Index: napalm-4.0.0/test/nxos/test_getters.py -=================================================================== ---- napalm-4.0.0.orig/test/nxos/test_getters.py -+++ napalm-4.0.0/test/nxos/test_getters.py -@@ -5,7 +5,7 @@ from napalm.base.test import helpers - from napalm.base import models - - import pytest --from mock import patch -+from unittest.mock import patch - - - def mock_time(): -Index: napalm-4.0.0/test/nxos_ssh/test_getters.py -=================================================================== ---- napalm-4.0.0.orig/test/nxos_ssh/test_getters.py -+++ napalm-4.0.0/test/nxos_ssh/test_getters.py -@@ -5,7 +5,7 @@ from napalm.base.test import helpers - from napalm.base import models - - import pytest --from mock import patch -+from unittest.mock import patch - - - def mock_time(): -Index: napalm-4.0.0/test/eos/test_heredoc.py -=================================================================== ---- napalm-4.0.0.orig/test/eos/test_heredoc.py -+++ napalm-4.0.0/test/eos/test_heredoc.py +From 9dd413d6254f2dc034903736b65b1853b2163e7d Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +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 -+import unittest.mock as 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(): diff --git a/python-napalm.changes b/python-napalm.changes index ed6848c..d4e44b4 100644 --- a/python-napalm.changes +++ b/python-napalm.changes @@ -1,3 +1,36 @@ +------------------------------------------------------------------- +Tue Dec 10 01:23:56 UTC 2024 - Steve Kowalik + +- 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 diff --git a/python-napalm.spec b/python-napalm.spec index 3f54b3f..c48ea37 100644 --- a/python-napalm.spec +++ b/python-napalm.spec @@ -1,7 +1,7 @@ # # spec file for package python-napalm # -# Copyright (c) 2023 SUSE LLC +# 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 @@ -17,18 +17,17 @@ Name: python-napalm -Version: 4.1.0 +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 -# https://github.com/napalm-automation/napalm/issues/1594 +# PATCH-FIX-UPSTREAM gh#napalm-automation/napalm#2155 Patch0: python-napalm-no-mock.patch -# https://github.com/napalm-automation/napalm/pull/1796 -Patch1: napalm-gh-pr1796-xmlgetparent.patch -# https://github.com/napalm-automation/napalm/pull/2002 -Patch2: remove-future-requirement.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} @@ -41,7 +40,7 @@ Requires: python-junos-eznc >= 2.6.3 Requires: python-lxml >= 4.3.0 Requires: python-ncclient Requires: python-netaddr -Requires: python-netmiko >= 4.0.0 +Requires: python-netmiko >= 4.4.0 Requires: python-netutils >= 1.0.0 Requires: python-paramiko >= 2.6.0 Requires: python-pyeapi >= 0.8.2 @@ -53,7 +52,7 @@ Requires: python-ttp Requires: python-ttp-templates Requires: python-typing_extensions Requires(post): update-alternatives -Requires(postun):update-alternatives +Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module Jinja2} @@ -64,7 +63,7 @@ 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.0.0} +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} diff --git a/remove-future-requirement.patch b/remove-future-requirement.patch deleted file mode 100644 index 427b301..0000000 --- a/remove-future-requirement.patch +++ /dev/null @@ -1,23 +0,0 @@ -From e384ae2dd6a2e157788f325f3e4fdf92349daec5 Mon Sep 17 00:00:00 2001 -From: Steve Kowalik -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 diff --git a/support-python-313.patch b/support-python-313.patch new file mode 100644 index 0000000..b1477e6 --- /dev/null +++ b/support-python-313.patch @@ -0,0 +1,117 @@ +From eca5aaecbd05305dda4b28ae4fbbcf40332aa909 Mon Sep 17 00:00:00 2001 +From: Kirk Byers +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