Files
napalm-opnsense/pyproject.toml
T
Christian Manivong c4ff19ac20
driver / standard (pull_request) Successful in 25s
driver / lint (pull_request) Successful in 26s
driver / types (pull_request) Failing after 35s
driver / test (3.13) (pull_request) Failing after 18s
driver / test (3.12) (pull_request) Failing after 21s
driver / lowest (pull_request) Failing after 17s
driver / build (pull_request) Successful in 30s
driver / security (pull_request) Failing after 40s
CI / driver (pull_request) Failing after 1m25s
driver / publish (pull_request) Skipped
feat(scheduled-jobs): the cron jobs of config.xml over the REST API (#43)
OPNsense keeps its cron jobs in its configuration and runs each as a
configd action, so the POSIX implementation does not fit: the driver has
no shell, and a job's command is not a shell line. The cron API reads and
writes them instead.

get_scheduled_jobs reads every job in one request (/api/cron/settings/get,
which carries the selected action rather than its display text). A job
another component registered is platform, one written by
put_scheduled_job carries the napalm-scheduled-job marker in its
description and is application, the rest admin. Every job can be enabled
and disabled; only an application's job is edited or deleted.
put_scheduled_job takes a configd action as command and refuses one
configd does not offer; get_scheduled_job_commands lists them. Running a
job now is refused: the API cannot run a configd action. Every write
reads the job again and refuses one whose digest changed.

Parameters are written one per line and only without blanks, quotes or
backslashes: OPNsense up to 26.1 splits them as a shell would, 26.7 takes
a line per argument, and only such arguments mean the same to both.

Requires napalm-device-types 4.26.0.

Closes #43
2026-11-03 05:44:29 +01:00

95 lines
2.2 KiB
TOML

[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
name = "napalm-opnsense"
version = "0.5.0"
description = "NAPALM driver for OPNsense (read-only via REST API)."
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.12"
authors = [
{ name = "Christian Manivong" },
]
classifiers = [
"Topic :: Utilities",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Typing :: Typed",
]
dependencies = [
"napalm>=5.1", # older releases import pkg_resources, which a 3.12 venv lacks
"napalm-device-types>=4.26.0",
"requests>=2.28.0",
]
[project.optional-dependencies]
dev = [
"pytest>=8",
"pytest-cov>=5",
"mypy>=1.11",
"ruff>=0.6",
]
[project.entry-points."napalm.drivers"]
opnsense = "napalm_opnsense.opnsense:OPNsenseDriver"
[project.urls]
Repository = "https://git.netork.io/NAPALM/napalm-opnsense"
Issues = "https://git.netork.io/NAPALM/napalm-opnsense/issues"
Changelog = "https://git.netork.io/NAPALM/napalm-opnsense/src/branch/main/CHANGELOG.md"
[tool.setuptools.packages.find]
where = ["."]
include = ["napalm_opnsense*"]
[tool.setuptools.package-data]
napalm_opnsense = ["py.typed"]
[tool.ruff]
line-length = 100
target-version = "py312"
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]
[tool.ruff.lint.per-file-ignores]
# Recorded device output keeps its lines.
"tests/**" = ["E501"]
[tool.mypy]
python_version = "3.12"
strict = true
# napalm itself is untyped, so every driver subclasses Any.
disallow_subclassing_any = false
[[tool.mypy.overrides]]
module = ["napalm.*", "requests.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
# Not yet under strict mypy (quality baseline); may only shrink.
module = [
"napalm_opnsense.ha",
"napalm_opnsense.listening",
"napalm_opnsense.opnsense",
"napalm_opnsense.ospf_mixin",
"napalm_opnsense.ping_mixin",
"napalm_opnsense.port_forwards",
"napalm_opnsense.resolver_mixin",
]
ignore_errors = true
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.coverage.run]
source = ["napalm_opnsense"]
[tool.coverage.report]
fail_under = 79