Files
napalm-opnsense/pyproject.toml
T
Christian Manivong 6fdc3ff2c7
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 1m1s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 1m3s
driver / lowest (pull_request) Successful in 36s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 58s
CI / driver (pull_request) Successful in 2m33s
driver / publish (pull_request) Skipped
feat(time-sync): read the time servers and zone of config.xml (NetOrk/netork#2363)
netOrk aligns every device with one list of time servers and a zone per
site (NetOrk/netork#2360) through napalm-device-types 4.35.0's
TimeSyncMixin. OPNsense keeps both in config.xml, <system><timeservers>
and <system><timezone>, set on the legacy pages services_ntpd.php and
system_general.php. No API controller reads or writes them, on 26.7 and
on master, so get_time_sync() reads them from the configuration download
get_config already uses and asks /api/ntpd/service/status whether ntpd
follows a system peer.

The driver writes neither value: time_sync_writes is empty and
configure_time_sync is None. Restoring an edited config.xml or running
the initial setup wizard would rewrite far more than the clock, on a box
that is often the gateway and its LAN's time server. TIME_SERVERS_MENU
and TIME_ZONE_MENU say where a person sets them, as SSH_SETTINGS_MENU
does for the SSH algorithms.

get_ntp_servers() now returns the same configured list. It read a
"peers" field the status endpoint does not have (it answers with ntpq's
associations as "rows") and so never found a server.
2026-11-11 15:20: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.6.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.35.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