-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update python-napalm-asa to version 20180525.8c54a85 / rev 5 via SR 1…
…056866 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 *
- Loading branch information
1 parent
db589ee
commit cf88e88
Showing
12 changed files
with
185 additions
and
31 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
d9a0f2b37a9aba072ac3b9643e3dd09e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<services> | ||
<service mode="disabled" name="tar_scm"> | ||
<param name="url">https://github.com/napalm-automation-community/napalm-asa.git</param> | ||
<param name="scm">git</param> | ||
<param name="exclude">.git</param> | ||
<param name="revision">master</param> | ||
<param name="versionformat">%cd.%h</param> | ||
<param name="changesgenerate">enable</param> | ||
<param name="filename">napalm-asa</param> | ||
<param name="changesauthor">[email protected]</param> | ||
</service> | ||
<service mode="disabled" name="recompress"> | ||
<param name="file">napalm-asa-*.tar</param> | ||
<param name="compression">xz</param> | ||
</service> | ||
<service mode="disabled" name="set_version"> | ||
</service> | ||
</services> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<servicedata> | ||
<service name="tar_scm"> | ||
<param name="url">https://github.com/napalm-automation-community/napalm-arubaos-switch.git</param> | ||
<param name="changesrevision">27ac4cef23ca6ccf99b212e73be7cb7c7b48244c</param></service><service name="tar_scm"> | ||
<param name="url">https://github.com/napalm-automation-community/napalm-asa.git</param> | ||
<param name="changesrevision">8c54a85c379a092ea946119732d42f45d351652c</param></service></servicedata> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
packages/p/python-napalm-asa/napalm-asa-20180525.8c54a85.tar.xz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/ipfs/bafkreiduqmq4funonbd2rqhp5ntrdolqfjvtuysxz5oegu6obe5z6mq3o4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
------------------------------------------------------------------- | ||
Thu Jan 05 14:54:34 UTC 2023 - [email protected] | ||
|
||
- 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 - [email protected] | ||
|
||
- 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á <[email protected]> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> | ||
# | ||
# 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 [email protected] | ||
# 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 [email protected] | ||
# 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 |