Napalm 4 compatibility, newer dependencies
This commit is contained in:
1 parent
7e1d345af6
commit
f3d13a5e31
5 files changed
+22
-31
No files matched your search
+5
-12
@@ -45,6 +45,8 @@ s350_base_interfaces = {
|
|||||||
"te": "TengigabitEthernet",
|
"te": "TengigabitEthernet",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
class S350Driver(NetworkDriver):
|
class S350Driver(NetworkDriver):
|
||||||
"""Napalm driver for S350."""
|
"""Napalm driver for S350."""
|
||||||
@@ -121,16 +123,6 @@ class S350Driver(NetworkDriver):
|
|||||||
"""Close the connection to the device."""
|
"""Close the connection to the device."""
|
||||||
self.device.disconnect()
|
self.device.disconnect()
|
||||||
|
|
||||||
def cli(self, commands):
|
|
||||||
output = {}
|
|
||||||
try:
|
|
||||||
for cmd in commands:
|
|
||||||
output[cmd] = self.device.send_command(cmd)
|
|
||||||
|
|
||||||
return output
|
|
||||||
except (socket.error, EOFError) as e:
|
|
||||||
raise ConnectionClosedException(str(e))
|
|
||||||
|
|
||||||
def _send_command(self, command):
|
def _send_command(self, command):
|
||||||
"""Wrapper for self.device.send.command().
|
"""Wrapper for self.device.send.command().
|
||||||
|
|
||||||
@@ -291,7 +283,8 @@ class S350Driver(NetworkDriver):
|
|||||||
fqdn = "{0}.{1}".format(hostname, domainname)
|
fqdn = "{0}.{1}".format(hostname, domainname)
|
||||||
|
|
||||||
# interface_list
|
# interface_list
|
||||||
interfaces = []
|
|
||||||
|
interfaces: List[str] = []
|
||||||
show_int_st = show_int_st.strip()
|
show_int_st = show_int_st.strip()
|
||||||
# remove the header information
|
# remove the header information
|
||||||
show_int_st = re.sub(
|
show_int_st = re.sub(
|
||||||
@@ -312,7 +305,7 @@ class S350Driver(NetworkDriver):
|
|||||||
"model": str(model),
|
"model": str(model),
|
||||||
"os_version": str(os_version),
|
"os_version": str(os_version),
|
||||||
"serial_number": str(serial_number),
|
"serial_number": str(serial_number),
|
||||||
"uptime": uptime,
|
"uptime": float(uptime),
|
||||||
"vendor": "Cisco",
|
"vendor": "Cisco",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
napalm>=3.0.0, <4.0.0
|
napalm<=4.0.0
|
||||||
netmiko>=3.1.0, <4.0.0
|
netmiko<=4.0.0
|
||||||
black
|
black<=24.3.0 # CVE-2024-21503
|
||||||
coveralls
|
coveralls
|
||||||
ddt
|
ddt
|
||||||
flake8-import-order
|
flake8-import-order
|
||||||
pytest==6.2.5
|
# pytest==6.2.5
|
||||||
|
pytest
|
||||||
pytest-cov
|
pytest-cov
|
||||||
pytest-json
|
pytest-json
|
||||||
pytest-pythonpath
|
pytest-pythonpath
|
||||||
pylama
|
pylama
|
||||||
pyflakes==2.4.0 #prevent problems
|
# pyflakes==2.4.0 #prevent problems
|
||||||
|
pyflakes
|
||||||
mock
|
mock
|
||||||
tox
|
tox
|
||||||
+3
-3
@@ -1,3 +1,3 @@
|
|||||||
napalm>=3.0.0, <4.0.0
|
napalm<=4.0.0
|
||||||
netmiko>=3.1.0, <4.0.0
|
netmiko<=4.0.0
|
||||||
netaddr
|
netaddr<=1.2.1
|
||||||
@@ -12,7 +12,7 @@ with open("README.md", "r") as fs:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="napalm-s350",
|
name="napalm-s350",
|
||||||
version="0.3.1",
|
version="0.4.0",
|
||||||
packages=find_packages(exclude=("test*",)),
|
packages=find_packages(exclude=("test*",)),
|
||||||
author="Jasper Lievisse Adriaanse, Petr Klíma, Daniel Bacher",
|
author="Jasper Lievisse Adriaanse, Petr Klíma, Daniel Bacher",
|
||||||
author_email="j@jasper.la, qaxi@seznam.cz, mail@phill93.de",
|
author_email="j@jasper.la, qaxi@seznam.cz, mail@phill93.de",
|
||||||
@@ -25,9 +25,12 @@ setup(
|
|||||||
"License :: OSI Approved :: Apache Software License",
|
"License :: OSI Approved :: Apache Software License",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
"Programming Language :: Python :: 3.6",
|
|
||||||
"Programming Language :: Python :: 3.7",
|
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"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 :: POSIX :: Linux",
|
||||||
"Operating System :: MacOS",
|
"Operating System :: MacOS",
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
#envlist = py3{6,7,8},black,pylama,sphinx
|
envlist = py3{8,9,10,11,12,13},pylama,black
|
||||||
envlist = py3{8,9,10,11,12},pylama,black
|
|
||||||
skip_missing_interpreters = true
|
skip_missing_interpreters = true
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
@@ -20,9 +19,3 @@ commands =
|
|||||||
commands =
|
commands =
|
||||||
pylama .
|
pylama .
|
||||||
|
|
||||||
[testenv:sphinx]
|
|
||||||
commands =
|
|
||||||
make doctest
|
|
||||||
|
|
||||||
whitelist_externals =
|
|
||||||
make
|
|
||||||
Reference in new issue
Block a user