napalm-device-types' SystemdServicesMixin (2.2.0) now provides get_services() and manage_service(); this driver supplies only the transport (#7): - _run_service_command(): unprivileged reads and root logins run as they are -- the user is asked once per session with "id -u", so a root login on a box without sudo is not prefixed with one. With a sudo password the command goes through _sudo(); without one through "sudo -n", which fails at once instead of hanging the session on a password prompt until the read timeout. - get_services(): one round trip instead of an is-enabled and a show per unit (6.0 s -> 0.8 s on a 184-unit Ubuntu host). A host without systemd still falls back to "service --status-all". - manage_service(): when sudo wants a password netOrk does not have, the failure says how to fix it -- the same hint the apt and SNMP actions give, now one constant (_SUDO_PASSWORD_HINT) instead of two copies. OpenMediaVault and QNAP inherit this driver. OMV gets service control with it; QNAP opts out (napalm-qnap-qts), since QTS has no systemd. README: the sudo option is sudo_password, not secret; manage_service and the systemctl permissions are listed. Closes #7
67 lines
1.5 KiB
TOML
67 lines
1.5 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=68", "wheel"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "napalm-linux"
|
|
version = "0.1.0"
|
|
description = "NAPALM driver for generic Linux systems via SSH"
|
|
readme = "README.md"
|
|
requires-python = ">=3.9"
|
|
license = { text = "Apache-2.0" }
|
|
authors = [
|
|
{ name = "Christian Manivong", email = "christian@manivong.de" },
|
|
]
|
|
keywords = [
|
|
"napalm",
|
|
"network",
|
|
"automation",
|
|
"linux",
|
|
"ssh",
|
|
"driver",
|
|
]
|
|
classifiers = [
|
|
"Development Status :: 3 - Alpha",
|
|
"Intended Audience :: Developers",
|
|
"Intended Audience :: System Administrators",
|
|
"License :: OSI Approved :: Apache Software License",
|
|
"Operating System :: OS Independent",
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3.9",
|
|
"Programming Language :: Python :: 3.10",
|
|
"Programming Language :: Python :: 3.11",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Topic :: System :: Networking",
|
|
"Topic :: System :: Systems Administration",
|
|
"Typing :: Typed",
|
|
]
|
|
dependencies = [
|
|
"napalm>=4.0",
|
|
"napalm-device-types>=2.2.0",
|
|
"netmiko>=4.0.0",
|
|
"paramiko>=5.0.0", # CVE-2026-44405
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest",
|
|
"pytest-cov",
|
|
"black",
|
|
"ruff",
|
|
"mypy",
|
|
]
|
|
|
|
[project.entry-points."napalm.drivers"]
|
|
linux = "napalm_linux:LinuxDriver"
|
|
|
|
[project.urls]
|
|
Repository = "https://github.com/chrismanivong/napalm-linux"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["."]
|
|
include = ["napalm_linux*"]
|
|
|
|
[tool.ruff]
|
|
line-length = 100
|
|
target-version = "py39"
|