Merge pull request #86 from napalm-automation-community/develop

Add security changes for black CVE-2024-21503, update test tools
This commit is contained in:
Petr Klíma authored and GitHub committed 2024-03-26 14:43:07 +01:00
commit b4fd77df46
8 files changed
+32 -23

No files matched your search

+3 -1
View File
@@ -11,7 +11,9 @@ on:
branches:
- develop
- master
# check every 14 days
schedule:
- cron: '0 6 5,20 * *'
jobs:
build:
+1 -1
View File
@@ -11,7 +11,7 @@ PyPi: [![Upload](https://github.com/napalm-automation-community/napalm-s350/work
## Requirements
Python 3.6+, napalm 3+
Python 3.8+, napalm 3
## Installation
+9 -6
View File
@@ -77,6 +77,8 @@ class S350Driver(NetworkDriver):
"alt_key_file": "",
"ssh_config_file": None,
"allow_agent": False,
"session_log": None,
"read_timeout_override": None,
}
# Allow for passing additional Netmiko arguments
@@ -87,6 +89,7 @@ class S350Driver(NetworkDriver):
except KeyError:
pass
self.platform = "s350"
self.port = optional_args.get("port", 22)
self.device = None
self.force_no_enable = optional_args.get("force_no_enable", False)
@@ -364,7 +367,7 @@ class S350Driver(NetworkDriver):
return uptime_str
def _get_facts_parse_inventory(self, show_inventory):
""" inventory can list more modules/devices """
"""inventory can list more modules/devices"""
# make 1 module 1 line
show_inventory = re.sub(r"\nPID", " PID", show_inventory, re.M)
# delete empty lines
@@ -471,7 +474,7 @@ class S350Driver(NetworkDriver):
entry = {
"is_up": is_up,
"is_enabled": is_enabled,
"speed": speed,
"speed": float(speed),
"mtu": mtu,
"last_flapped": -1.0,
"description": description,
@@ -523,7 +526,7 @@ class S350Driver(NetworkDriver):
return interfaces
def _get_ip_int_line_to_fields(self, line, fields_end):
""" dynamic fields lenghts """
"""dynamic fields lenghts"""
line_elems = {}
index = 0
f_start = 0
@@ -534,7 +537,7 @@ class S350Driver(NetworkDriver):
return line_elems
def _get_ip_int_fields_end(self, dashline):
""" fields length are diferent device to device, detect them on horizontal lin """
"""fields length are diferent device to device, detect them on horizontal line"""
fields_end = [m.start() for m in re.finditer(" ", dashline.strip())]
# fields_position.insert(0,0)
@@ -588,7 +591,7 @@ class S350Driver(NetworkDriver):
return neighbors
def _get_lldp_neighbors_line_to_fields(self, line, fields_end):
""" dynamic fields lenghts """
"""dynamic fields lenghts"""
line_elems = {}
index = 0
f_start = 0
@@ -599,7 +602,7 @@ class S350Driver(NetworkDriver):
return line_elems
def _get_lldp_neighbors_fields_end(self, dashline):
""" fields length are diferent device to device, detect them on horizontal lin """
"""fields length are diferent device to device, detect them on horizontal line"""
fields_end = [m.start() for m in re.finditer(" ", dashline)]
fields_end.append(len(dashline))
+14 -12
View File
@@ -1,12 +1,14 @@
black==20.8b1
coveralls==2.1.2
ddt==1.4.1
flake8-import-order==0.18.1
pytest==5.4.3
pytest-cov==2.10.1
pytest-json==0.4.0
pytest-pythonpath==0.7.3
pylama==7.7.1
mock==4.0.2
tox==3.20.1
demjson
napalm>=3.0.0, <4.0.0
netmiko>=3.1.0, <4.0.0
black
coveralls
ddt
flake8-import-order
pytest==6.2.5
pytest-cov
pytest-json
pytest-pythonpath
pylama
pyflakes==2.4.0 #prevent problems
mock
tox
+2 -2
View File
@@ -1,3 +1,3 @@
napalm>=3.0.0
netmiko>=3.1.0
napalm>=3.0.0, <4.0.0
netmiko>=3.1.0, <4.0.0
netaddr
+1
View File
@@ -1,4 +1,5 @@
"""Test fixtures."""
from builtins import super
import pytest
+1
View File
@@ -1,4 +1,5 @@
"""Tests for getters."""
from napalm.base.test.getters import BaseTestGetters
import pytest
+1 -1
View File
@@ -1,6 +1,6 @@
[tox]
#envlist = py3{6,7,8},black,pylama,sphinx
envlist = py3{6,7,8},pylama,black
envlist = py3{8,9,10,11,12},pylama,black
skip_missing_interpreters = true
[testenv]