From cf88e88f13d13bfcf6df325f4543c9a5d764ac56 Mon Sep 17 00:00:00 2001 From: mcepl <> Date: Sun, 8 Jan 2023 20:25:46 +0000 Subject: [PATCH] Update python-napalm-asa to version 20180525.8c54a85 / rev 5 via SR 1056866 https://build.opensuse.org/request/show/1056866 by user mcepl + dimstar_suse - Update to version 20180525.8c54a85: * Version bump * Implement token auth (#17) * Add built status and pypi version to README * PY3 compatibility for tests * Fix style and add optinal_args protection against falsy value * Add .travis.yaml * Support for rest-api agents that run on non-standard tcp port. (#14) * Clean up after replacing url2libe with requests * Removing pylama.ini * Replace urllib2 with requests - Add napalm-py23_compat.patch to fix missing py23_compat.py file (gh#napalm-automation-community/napalm-asa#35). - Add pylama.patch to fix two problems discovered by pylama (gh#napalm-automation-community/napalm-asa#36). - Switch to git checkout version (releases are significantly lagging). - Update to version 20211220.27ac4ce: * get_interfaces added * --- packages/p/python-napalm-asa/.files | Bin 250 -> 407 bytes packages/p/python-napalm-asa/.rev | 33 +++++++++++++ packages/p/python-napalm-asa/.servicemark | 1 + packages/p/python-napalm-asa/_service | 18 +++++++ packages/p/python-napalm-asa/_servicedata | 6 +++ .../p/python-napalm-asa/float-speed.patch | 13 ----- .../python-napalm-asa/napalm-asa-0.1.4.tar.gz | 1 - .../napalm-asa-20180525.8c54a85.tar.xz | 1 + .../p/python-napalm-asa/py23_compat.patch | 41 ++++++++++++++++ packages/p/python-napalm-asa/pylama.patch | 24 ++++++++++ .../python-napalm-asa.changes | 33 +++++++++++++ .../python-napalm-asa/python-napalm-asa.spec | 45 +++++++++++------- 12 files changed, 185 insertions(+), 31 deletions(-) create mode 100644 packages/p/python-napalm-asa/.servicemark create mode 100644 packages/p/python-napalm-asa/_service create mode 100644 packages/p/python-napalm-asa/_servicedata delete mode 100644 packages/p/python-napalm-asa/float-speed.patch delete mode 120000 packages/p/python-napalm-asa/napalm-asa-0.1.4.tar.gz create mode 120000 packages/p/python-napalm-asa/napalm-asa-20180525.8c54a85.tar.xz create mode 100644 packages/p/python-napalm-asa/py23_compat.patch create mode 100644 packages/p/python-napalm-asa/pylama.patch diff --git a/packages/p/python-napalm-asa/.files b/packages/p/python-napalm-asa/.files index 53c1194553200de7675222bef5d243f7231b4780..b2edfef47885d578cdd242eb2a52b5cb8f07975c 100644 GIT binary patch literal 407 zcmZXQK}!TN422g&lwmJk1aE`)9on>M(_gcsN$LvjI_wPM`s?i?;=w>}@5{@3^Rl|z z;bybh+zq3PQbfVGU@=q4z~ViySBaQH;I4X{FYDp`v^(+4Z^s=kJT0@yFbbdrf|gur z>{N1U*>RTG7=hF}d%s`o{P8L_j1;k20tII^MMs~M8&A7mZD^WJ(`Q^Y7&r|lC|8i=f5g;;5<15oJcS-;k5F3`uytckXP%;TCosI YFBK{mSNl8Y3*>9w?RWtyhf zd7(^B6AEC8eoK`kP=LZYV(=niq(0iS?~h|WsL}1d(n;oQ!t>&XDn4Yk85MKbT-BV_ zGJtvrGVJFcTESR@rqh?Xe$Pv+Ai)8k0}iRW?1qgD?2!Rg2Y%PvgZetgq?$&Z_pzzv ex8Idi*n;z$L~mUwsFiC%8tn4_FYk0*<@^CzbVX|b diff --git a/packages/p/python-napalm-asa/.rev b/packages/p/python-napalm-asa/.rev index df280026b6e..eb9f8c6bd68 100644 --- a/packages/p/python-napalm-asa/.rev +++ b/packages/p/python-napalm-asa/.rev @@ -37,4 +37,37 @@ 999338 + + 16fca71ca99a9afee53fa9fd2552c2f6 + 20180525.8c54a85 + + dimstar_suse + - Update to version 20180525.8c54a85: + * Version bump + * Implement token auth (#17) + * Add built status and pypi version to README + * PY3 compatibility for tests + * Fix style and add optinal_args protection against falsy value + * Add .travis.yaml + * Support for rest-api agents that run on non-standard tcp port. (#14) + * Clean up after replacing url2libe with requests + * Removing pylama.ini + * Replace urllib2 with requests +- Add napalm-py23_compat.patch to fix missing py23_compat.py file + (gh#napalm-automation-community/napalm-asa#35). +- Add pylama.patch to fix two problems discovered by pylama + (gh#napalm-automation-community/napalm-asa#36). +- Switch to git checkout version (releases are significantly + lagging). +- Update to version 20211220.27ac4ce: + * get_interfaces added + * keep_alive re-written + * workaround for slow devices + * Session object reverted back to requests.Session +- Skip failing tests (gh#napalm-automation-community/napalm-asa#34) +- Remove float-speed.patch which has been made irrelevant by the + development upstream. + + 1056866 + diff --git a/packages/p/python-napalm-asa/.servicemark b/packages/p/python-napalm-asa/.servicemark new file mode 100644 index 00000000000..0d7fd3977e7 --- /dev/null +++ b/packages/p/python-napalm-asa/.servicemark @@ -0,0 +1 @@ +d9a0f2b37a9aba072ac3b9643e3dd09e diff --git a/packages/p/python-napalm-asa/_service b/packages/p/python-napalm-asa/_service new file mode 100644 index 00000000000..cd40d16ba5f --- /dev/null +++ b/packages/p/python-napalm-asa/_service @@ -0,0 +1,18 @@ + + + https://github.com/napalm-automation-community/napalm-asa.git + git + .git + master + %cd.%h + enable + napalm-asa + mcepl@cepl.eu + + + napalm-asa-*.tar + xz + + + + diff --git a/packages/p/python-napalm-asa/_servicedata b/packages/p/python-napalm-asa/_servicedata new file mode 100644 index 00000000000..6313da74d6c --- /dev/null +++ b/packages/p/python-napalm-asa/_servicedata @@ -0,0 +1,6 @@ + + + https://github.com/napalm-automation-community/napalm-arubaos-switch.git + 27ac4cef23ca6ccf99b212e73be7cb7c7b48244c + https://github.com/napalm-automation-community/napalm-asa.git + 8c54a85c379a092ea946119732d42f45d351652c \ No newline at end of file diff --git a/packages/p/python-napalm-asa/float-speed.patch b/packages/p/python-napalm-asa/float-speed.patch deleted file mode 100644 index ee6296f1626..00000000000 --- a/packages/p/python-napalm-asa/float-speed.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: napalm-asa-0.1.4/napalm_asa/asa.py -=================================================================== ---- napalm-asa-0.1.4.orig/napalm_asa/asa.py -+++ napalm-asa-0.1.4/napalm_asa/asa.py -@@ -334,7 +334,7 @@ class ASADriver(NetworkDriver): - "is_enabled": not int_info["shutdown"], - "description": int_info["interfaceDesc"], - "last_flapped": -1.0, -- "speed": 0, -+ "speed": 0.0, - "mtu": 0, - "mac_address": "", - } diff --git a/packages/p/python-napalm-asa/napalm-asa-0.1.4.tar.gz b/packages/p/python-napalm-asa/napalm-asa-0.1.4.tar.gz deleted file mode 120000 index 51f59d4fac4..00000000000 --- a/packages/p/python-napalm-asa/napalm-asa-0.1.4.tar.gz +++ /dev/null @@ -1 +0,0 @@ -/ipfs/bafkreih5e75a4wx73kq2qgbeozu57fsm23jncphvzj7sj3c26fdkvn6fja \ No newline at end of file diff --git a/packages/p/python-napalm-asa/napalm-asa-20180525.8c54a85.tar.xz b/packages/p/python-napalm-asa/napalm-asa-20180525.8c54a85.tar.xz new file mode 120000 index 00000000000..8ec0144b88b --- /dev/null +++ b/packages/p/python-napalm-asa/napalm-asa-20180525.8c54a85.tar.xz @@ -0,0 +1 @@ +/ipfs/bafkreiduqmq4funonbd2rqhp5ntrdolqfjvtuysxz5oegu6obe5z6mq3o4 \ No newline at end of file diff --git a/packages/p/python-napalm-asa/py23_compat.patch b/packages/p/python-napalm-asa/py23_compat.patch new file mode 100644 index 00000000000..76242453965 --- /dev/null +++ b/packages/p/python-napalm-asa/py23_compat.patch @@ -0,0 +1,41 @@ +--- + napalm_asa/asa.py | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/napalm_asa/asa.py ++++ b/napalm_asa/asa.py +@@ -30,7 +30,6 @@ from collections import OrderedDict + from netaddr import IPNetwork + + from napalm.base import NetworkDriver +-from napalm.base.utils import py23_compat + from napalm.base.exceptions import ( + ConnectionException, + CommandErrorException, +@@ -70,7 +69,7 @@ class RespFetcherHttps: + else: + return (False, token_request.status_code) + except requests.exceptions.RequestException as e: +- raise ConnectionException(py23_compat.text_type(e)) ++ raise ConnectionException(str(e)) + + def delete_token(self): + """Delete auth token.""" +@@ -85,7 +84,7 @@ class RespFetcherHttps: + else: + return (False, token_delete_request.status_code) + except requests.exceptions.RequestException as e: +- raise ConnectionException(py23_compat.text_type(e)) ++ raise ConnectionException(str(e)) + + def get_resp(self, endpoint="", data=None): + """Get response from device and returne parsed json.""" +@@ -103,7 +102,7 @@ class RespFetcherHttps: + + return f.json() + except requests.exceptions.RequestException as e: +- raise ConnectionException(py23_compat.text_type(e)) ++ raise ConnectionException(str(e)) + + + class ASADriver(NetworkDriver): diff --git a/packages/p/python-napalm-asa/pylama.patch b/packages/p/python-napalm-asa/pylama.patch new file mode 100644 index 00000000000..a6bb99dfc99 --- /dev/null +++ b/packages/p/python-napalm-asa/pylama.patch @@ -0,0 +1,24 @@ +--- + napalm_asa/asa.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/napalm_asa/asa.py ++++ b/napalm_asa/asa.py +@@ -62,7 +62,7 @@ class RespFetcherHttps: + try: + token_request = self.session.post(full_url, auth=(self.username, self.password), + data="", timeout=self.timeout, verify=False) +- if token_request.status_code is 204 and 'X-Auth-Token' in token_request.headers.keys(): ++ if token_request.status_code == 204 and 'X-Auth-Token' in token_request.headers.keys(): + self.token = token_request.headers['X-Auth-Token'] + self.session.headers.update({'X-Auth-Token': token_request.headers['X-Auth-Token']}) + return (True, None) +@@ -78,7 +78,7 @@ class RespFetcherHttps: + token_delete_request = self.session.delete(full_url, + auth=(self.username, self.password), + timeout=self.timeout, verify=False) +- if token_delete_request.status_code is 204: ++ if token_delete_request.status_code == 204: + self.session.headers.pop('X-Auth-Token', None) + return (True, None) + else: diff --git a/packages/p/python-napalm-asa/python-napalm-asa.changes b/packages/p/python-napalm-asa/python-napalm-asa.changes index c855c838034..2a05eff050a 100644 --- a/packages/p/python-napalm-asa/python-napalm-asa.changes +++ b/packages/p/python-napalm-asa/python-napalm-asa.changes @@ -1,3 +1,36 @@ +------------------------------------------------------------------- +Thu Jan 05 14:54:34 UTC 2023 - mcepl@cepl.eu + +- Update to version 20180525.8c54a85: + * Version bump + * Implement token auth (#17) + * Add built status and pypi version to README + * PY3 compatibility for tests + * Fix style and add optinal_args protection against falsy value + * Add .travis.yaml + * Support for rest-api agents that run on non-standard tcp port. (#14) + * Clean up after replacing url2libe with requests + * Removing pylama.ini + * Replace urllib2 with requests +- Add napalm-py23_compat.patch to fix missing py23_compat.py file + (gh#napalm-automation-community/napalm-asa#35). +- Add pylama.patch to fix two problems discovered by pylama + (gh#napalm-automation-community/napalm-asa#36). + +------------------------------------------------------------------- +Tue Jan 03 21:30:47 UTC 2023 - mcepl@cepl.eu + +- Switch to git checkout version (releases are significantly + lagging). +- Update to version 20211220.27ac4ce: + * get_interfaces added + * keep_alive re-written + * workaround for slow devices + * Session object reverted back to requests.Session +- Skip failing tests (gh#napalm-automation-community/napalm-asa#34) +- Remove float-speed.patch which has been made irrelevant by the + development upstream. + ------------------------------------------------------------------- Thu Aug 25 08:08:17 UTC 2022 - Markéta Machová diff --git a/packages/p/python-napalm-asa/python-napalm-asa.spec b/packages/p/python-napalm-asa/python-napalm-asa.spec index d5c2f3c23ce..ff7cdd95614 100644 --- a/packages/p/python-napalm-asa/python-napalm-asa.spec +++ b/packages/p/python-napalm-asa/python-napalm-asa.spec @@ -1,7 +1,7 @@ # # spec file for package python-napalm-asa # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # Copyright (c) 2019, Martin Hauke # # All modifications and additions to the file contributed by third parties @@ -17,27 +17,32 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -# skip py2 as napalm dropped py2 %define skip_python2 1 Name: python-napalm-asa -Version: 0.1.4 +%define base_version 0.1.1 +Version: 20180525.8c54a85 Release: 0 Summary: NAPALM - Cisco ASA Driver network driver License: Apache-2.0 URL: https://github.com/napalm-automation-community/napalm-asa -Source: https://github.com/napalm-automation-community/napalm-asa/archive/v%{version}.tar.gz#/napalm-asa-%{version}.tar.gz -# PATCH-FIX-UPSTREAM https://github.com/napalm-automation-community/napalm-asa/pull/33 float speed -Patch0: float-speed.patch -BuildRequires: %{python_module setuptools} +# Source: https://github.com/napalm-automation-community/napalm-asa/archive/v%%{version}.tar.gz#/napalm-asa-%%{version}.tar.gz +Source: napalm-asa-%{version}.tar.xz +# PATCH-FIX-UPSTREAM napalm-py23_compat.patch gh#napalm-automation-community/napalm-asa#35 mcepl@suse.com +# Make tests pass even when we removed napalm.base.utils.py23_compat +Patch0: py23_compat.patch +# PATCH-FIX-UPSTREAM pylama.patch gh#napalm-automation-community/napalm-asa#36 mcepl@suse.com +# Fix problems discovered by pylama +Patch1: pylama.patch +BuildRequires: %{python_module packaging} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-napalm >= 2.5.0 BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module napalm >= 2.5.0} +BuildRequires: %{python_module napalm >= 4.0.0} BuildRequires: %{python_module pylama} -BuildRequires: %{python_module pytest-cov} BuildRequires: %{python_module pytest} # /SECTION %python_subpackages @@ -49,22 +54,28 @@ available from software version 9.3.2 and up, and on the 5500-X series, ASAv, ASA on Firepower and ISA 3000 platforms. %prep -%setup -q -n napalm-asa-%{version} -%autopatch -p1 +%autosetup -p1 -n napalm-asa-%{version} + +sed -i -E '/--cov/d' setup.cfg %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest -k "not test_get_config_filtered" +# gh#napalm-automation-community/napalm-asa#34 +skip_tests="test_get_facts or test_get_interfaces " +skip_tests+=" or test_method_signatures or test_traceroute" +skip_tests+=" or test_get_config_filtered or test_get_config_sanitized" +%pytest -k "not (${skip_tests})" %files %{python_files} %license LICENSE -%doc AUTHORS README.md -%{python_sitelib}/* +%doc README.md CONTRIBUTING AUTHORS +%{python_sitelib}/napalm_asa +%{python_sitelib}/napalm_asa-%{base_version}*-info %changelog