Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c3dea8ec10 | ||
|
|
6e6b38b224 | ||
|
|
3a63056fa8 | ||
|
|
08d9a45e77 | ||
|
|
fc9e83c4bb | ||
|
|
9025b0f434 | ||
|
|
d6dd81ea81 | ||
|
|
7a8fbac693 | ||
|
|
a4f0473fd2 | ||
|
|
62f6ab4cc3 | ||
|
|
7009fc9121 | ||
|
|
cfd1169760 | ||
|
|
f3d13a5e31 | ||
|
|
5a9bff81b9 | ||
|
|
e939d9e73d |
No files matched your search
@@ -0,0 +1,40 @@
|
|||||||
|
# This workflows will upload a Python Package using Twine when a release is created
|
||||||
|
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
||||||
|
|
||||||
|
name: Fast Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- develop
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches-ignore:
|
||||||
|
- develop
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
tox_test:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: [ "3.11" ]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
|
||||||
|
|
||||||
|
- name: Test with tox
|
||||||
|
run: |
|
||||||
|
tox
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
# This workflows will upload a Python Package using Twine when a release is created
|
# This workflows will upload a Python Package using Twine when a release is created
|
||||||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
||||||
|
|
||||||
name: Publish Python Package to PyPi.org
|
name: Publish To PyPi.org
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
# This workflows will upload a Python Package using Twine when a release is created
|
|
||||||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
|
||||||
|
|
||||||
name: Test before push
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
- master
|
|
||||||
# check every 14 days
|
|
||||||
schedule:
|
|
||||||
- cron: '0 6 5,20 * *'
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Set up Python 3.x
|
|
||||||
uses: actions/setup-python@v2
|
|
||||||
with:
|
|
||||||
python-version: '3.x'
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -r requirements.txt
|
|
||||||
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
|
|
||||||
- name: Test with tox
|
|
||||||
run: |
|
|
||||||
tox
|
|
||||||
|
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# This workflows will upload a Python Package using Twine when a release is created
|
||||||
|
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
||||||
|
|
||||||
|
name: Thorough Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
- master
|
||||||
|
# check every 14 days
|
||||||
|
schedule:
|
||||||
|
- cron: '0 6 5,20 * *'
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
tox_test:
|
||||||
|
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
|
||||||
|
|
||||||
|
- name: Test with tox
|
||||||
|
run: |
|
||||||
|
tox
|
||||||
@@ -11,7 +11,7 @@ PyPi: [:
|
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 = py,pylama,black
|
||||||
envlist = py3{8,9,10,11,12},pylama,black
|
|
||||||
skip_missing_interpreters = true
|
skip_missing_interpreters = true
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
@@ -14,15 +13,9 @@ commands =
|
|||||||
|
|
||||||
[testenv:black]
|
[testenv:black]
|
||||||
commands =
|
commands =
|
||||||
black --check --target-version py36 --line-length 100 --color --diff .
|
black --check --target-version py312 --line-length 100 --color --diff .
|
||||||
|
|
||||||
[testenv:pylama]
|
[testenv:pylama]
|
||||||
commands =
|
commands =
|
||||||
pylama .
|
pylama .
|
||||||
|
|
||||||
[testenv:sphinx]
|
|
||||||
commands =
|
|
||||||
make doctest
|
|
||||||
|
|
||||||
whitelist_externals =
|
|
||||||
make
|
|
||||||
Reference in new issue
Block a user