Files
napalm-windows/CHANGELOG.md
T
Christian Manivong 0b30ab00a5
driver / standard (pull_request) Successful in 14s
driver / lint (pull_request) Successful in 14s
driver / types (pull_request) Successful in 57s
driver / test (3.12) (pull_request) Successful in 58s
driver / test (3.13) (pull_request) Successful in 51s
driver / lowest (pull_request) Successful in 26s
driver / build (pull_request) Successful in 27s
driver / security (pull_request) Successful in 57s
CI / driver (pull_request) Successful in 2m23s
driver / publish (pull_request) Skipped
feat(time-sync): w32time's servers and the time zone through TimeSyncMixin
netOrk keeps one list of NTP servers and a time zone per site and aligns
a device that differs (NetOrk/netork#2360). A Windows host takes part
through w32time and its time zone, in one PowerShell script per read.

The servers and the mode are read from w32time's registry values, group
policy's first, not from w32tm /query /configuration, whose text is in
the host's language; synchronised is the leap indicator on the first
line of w32tm /query /status, which reads the same in any language. The
servers are written the way w32tm /config /manualpeerlist
/syncfromflags:manual writes them (NtpServer with 0x8, Type NTP),
followed by w32tm /config /update: no value passes a native command
line, whose quoting Windows PowerShell 5.1 mangles. A domain member that
takes its time from the domain hierarchy (NT5DS, AllSync) and a host
whose w32time comes from group policy refuse the write: their time is
set elsewhere, and a local write would be overridden or break the
domain's time.

Windows keeps a Windows zone, which stands for several IANA zones, so
Europe/Vienna written would read back as Europe/Berlin and the poll
would align the host forever. The IANA name written is kept beside it
in HKLM\SOFTWARE\napalm-windows and read back while the host is still
in that Windows zone. The zone is read from the registry, which
[TimeZoneInfo]::Local caches for the life of the remote session.

The zone table is now CLDR's windowsZones.xml (release 49) both ways,
generated by tools/windows_zones.py with tzdata's links and committed
with its source and checksum; nothing is fetched at runtime. CLDR's old
names (Asia/Calcutta) read as their current ones (Asia/Kolkata).

Writes the host already has are skipped. Needs napalm-device-types
4.35.0.

Refs NetOrk/netork#2367
2026-11-11 15:27:56 +01:00

72 lines
4.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Changelog
All notable changes to this driver. The format follows
[Keep a Changelog](https://keepachangelog.com/), versions follow
[Semantic Versioning](https://semver.org/).
## [Unreleased]
### Added
- Time sync: napalm-device-types' `TimeSyncMixin` (4.35.0), servers and zone
(NetOrk/netork#2367). `get_time_sync` reads w32time's `NtpServer` and `Type` from the
registry (group policy's first; `NoSync` has no servers), whether the clock is
synchronised (the leap indicator of `w32tm /query /status`) and the zone, in one
script. `configure_time_sync` writes the servers as `<server>,0x8` with `Type NTP`
and `w32tm /config /update`, starting a stopped Windows Time service, and the zone
with `Set-TimeZone`. A domain member that takes its time from the domain hierarchy
(`NT5DS`, `AllSync`) reports its configured servers and refuses the write, as does a
host whose w32time settings come from group policy. The IANA name written is kept in
`HKLM\SOFTWARE\napalm-windows` so it reads back as written; writes the host already
has are skipped.
- The time zone table is CLDR's `windowsZones.xml` (release 49), generated into
`napalm_windows/_windows_zones.py` by `tools/windows_zones.py` with tzdata's links,
both ways: every Windows zone reads as an IANA name, not only the common ones, and
every IANA zone CLDR maps has its Windows zone.
- Scheduled jobs: the Task Scheduler as napalm-device-types' `ScheduledJobsMixin` (#8).
`get_scheduled_jobs` reads every task with its last and next run in one script
(`Get-ScheduledTask`, `Get-ScheduledTaskInfo`) as `task:<path><name>`: a task under
`\Microsoft\` is the `platform`'s, any other the `admin`'s, and a task in the root
folder whose description starts with `napalm-scheduled-job: <name>` an `application`'s.
The time zone comes as an IANA name for the common Windows zones, else `None`.
`manage_scheduled_job` enables, disables (`Enable-`/`Disable-ScheduledTask`) or starts
one (`Start-ScheduledTask`, which returns once the task has started). `put_scheduled_job`
registers an application's task `\<name>` from XML: the command runs in
`cmd.exe /d /s /c`, `SYSTEM` or a local user without a stored password (S4U), and the
cron expression becomes triggers where Task Scheduler can express it exactly; any other
shape is refused, naming why. `delete_scheduled_job` unregisters it. Every write reads
the task again first and refuses over a change it did not see. Fixture synthetic.
### Changed
- The floor on napalm-device-types is 4.35.0, which declares the time sync contract.
- Python 3.12 is the floor (`requires-python = ">=3.12"`): netOrk runs every driver
on 3.12, so 3.10 and 3.11 are no longer tested (NAPALM/driver-standard#6).
- The floor on napalm is 5.1: older releases import `pkg_resources`, which a Python
3.12 venv no longer has.
### Fixed
- `get_arp_table()` reports an unknown age as `-1.0` (napalm-device-types'
`ARP_AGE_UNKNOWN`) instead of `0.0`, which means "confirmed just now":
`Get-NetNeighbor` has a state but no age (NetOrk/netork#1327).
## [0.2.0] - 2026-10-23
The first release on PyPI.
### Added
- PowerShell Remoting transport over WinRM (pypsrp), one runspace pool per connection.
- `get_facts`, `get_interfaces`, `get_interfaces_ip`, `get_arp_table`, `get_route_to`.
- `get_services` and `manage_service` (start, stop, restart, enable, disable).
- `get_listening_sockets`: every listening TCP and bound UDP socket with its process and,
where the process runs one Windows service, that service (netOrk #673). Fixture synthetic.
- Discovery fingerprints: WinRM ports 5985/5986, `Microsoft-HTTPAPI` / `Microsoft-IIS`
server headers, Windows SNMP `sysDescr`, OpenSSH-for-Windows banner.
- `tools/harvest.py` to record real script output as test fixtures.
### Changed
- The driver follows the NAPALM driver standard
(https://git.netork.io/NAPALM/driver-standard): CI on Gitea runs ruff, mypy, the
tests on Python 3.10–3.13 and at the lowest declared versions, bandit, pip-audit and
a build check, and a release tag publishes to PyPI. The package now ships `py.typed`
and a LICENSE file. **Python 3.9 is no longer supported**; napalm-device-types never
ran on it, and 4.21.1 from PyPI is now the oldest it accepts.