The checks against line breaks and double quotes made the driver module
27 lines longer than the quality ratchet allows (2014, recorded 1987) and
set_interface 53 lines long (limit 50).
The checks move to cli_values.py (check_cli_values); the uptime parser,
a pure parser without the driver, moves to parsers.py as
parse_uptime_seconds and reads its four units in one loop; set_vlan and
set_interface say in one docstring line what they refuse. Behaviour is
unchanged; the uptime test gains a string without days and an empty one.
The baseline is lowered to what is measured now (1971).
netOrk aligns every device's NTP servers and time zone with its site's
(NetOrk/netork#2360, #2366). A JetStream keeps both in one line,
system-time ntp <zone> <primary> <backup> <hours>, with the zone as a
UTC offset from a fixed list and summer time in a system-time dst line
of its own.
get_time_sync() reads the servers from that line and the zone as None:
the switch keeps no name to map back. configure_time_sync() writes an
IANA zone as its offset and a dst recurring rule from the zone's POSIX
rule (posix_tz/parse_posix_tz), and refuses before sending anything
what the switch cannot take: more than two servers, anything but IPv4
addresses, an offset it does not offer, a change outside HH:MM of a day.
Servers and zone share the ntp line, so a call with both writes it once.
A change is saved to the startup configuration; values the switch
already has are not sent again, so the alignment on every poll does not
churn.
The code lives in time_sync.py; get_ntp_servers() now reads through it,
so the driver file shrinks (1999 -> 1987 lines).
The switch's community table starts with an Index column. The getter
took the first word of each row as the community, so "public" was
reported as "1", and read the access from the second word, the name,
so every community came out read-only. It now uses the header-based
community table parser: the name from Name, the access from Type.
Closes#14
The switch's community table starts with an Index column, and
get_snmp_config took a row's first word, so it reported the community
as "1". The name now comes from the column headed Name, found in the
header line above the dashes; the tests read the recorded table.
Found while recording fixtures for #3.
get_snmp_config started from community "public" and returned it with
running=True when no row of the community table parsed. Without a listed
community it now reports the agent as not running, as it already did for
"no community entry exists".
The issue's other two points were already fixed on main: the management
VLAN is matched exactly since c2f0f7c (_management_vlan, with the
caller's listen address), and the floor on napalm-device-types is 4.21.1
with no requirements.txt since 4e171bf.
Closes#3
Each "Request timed out" line went into results with the timeout as its
RTT. NAPALM's results hold replies, and a sweep treats a non-empty
results list as a live host, so dead hosts showed up in LAN scans.
Closes#2
- CI moves to .gitea/workflows/ci.yml and calls the shared driver workflow
of NAPALM/driver-standard. .github/ goes with publish.yml and tests.yml:
PyPI Trusted Publishing never worked from Gitea.
- requirements.txt goes: it only repeated the pyproject dependencies, with
an older napalm-device-types floor and without paramiko.
- LICENSE file (the README already pointed to it), CHANGELOG, py.typed,
SPDX license string, links to git.netork.io (README included);
napalm-device-types >=4.21.1, a dev extra with floors.
- netaddr gets a true floor (>=0.7.10): unbounded, the lowest job
installed a version without IPAddress, which napalm imports.
- mypy strict for the package; napalm_tplink_jetstream.tplink_jetstream is
exempt for now (96 errors), recorded in the quality baseline with its
long functions and the 2000-line module. Coverage floor 36 % (measured
36.71 %).