Skip to content

Commit

Permalink
Merge pull request #85 from napalm-automation-community/dependabot/pi…
Browse files Browse the repository at this point in the history
…p/black-24.3.0

Bump black from 20.8b1 to 24.3.0 to address CVE-2024-21503
  • Loading branch information
qaxi authored Mar 26, 2024
2 parents 5da4d3d + 7929c64 commit d1b960a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
13 changes: 7 additions & 6 deletions napalm_s350/s350.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def __init__(self, hostname, username, password, timeout=60, optional_args=None)
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)
Expand Down Expand Up @@ -366,7 +367,7 @@ def _get_facts_uptime(self, show_sys):
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
Expand Down Expand Up @@ -473,7 +474,7 @@ def get_interfaces(self):
entry = {
"is_up": is_up,
"is_enabled": is_enabled,
"speed": speed,
"speed": float(speed),
"mtu": mtu,
"last_flapped": -1.0,
"description": description,
Expand Down Expand Up @@ -525,7 +526,7 @@ def get_interfaces_ip(self):
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
Expand All @@ -536,7 +537,7 @@ def _get_ip_int_line_to_fields(self, line, fields_end):
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)
Expand Down Expand Up @@ -590,7 +591,7 @@ def get_lldp_neighbors(self):
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
Expand All @@ -601,7 +602,7 @@ def _get_lldp_neighbors_line_to_fields(self, line, fields_end):
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))
Expand Down
26 changes: 14 additions & 12 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions test/unit/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test fixtures."""

from builtins import super

import pytest
Expand Down
1 change: 1 addition & 0 deletions test/unit/test_getters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for getters."""

from napalm.base.test.getters import BaseTestGetters
import pytest

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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]
Expand Down

0 comments on commit d1b960a

Please sign in to comment.