fix(session): report is_alive from the driver's own session
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 19s
driver / types (pull_request) Successful in 1m5s
driver / test (3.12) (pull_request) Successful in 1m3s
driver / lowest (pull_request) Successful in 34s
driver / test (3.13) (pull_request) Successful in 1m9s
driver / build (pull_request) Successful in 31s
driver / security (pull_request) Successful in 1m12s
CI / driver (pull_request) Successful in 2m53s
driver / publish (pull_request) Skipped

is_alive() opened a TCP connection to the gateway whether or not the
driver was opened, and after close() too. NAPALM's __del__ asks it of
every collected driver, so each one connected once more and could stall
for up to five seconds. Without an open session it now answers False
and connects nowhere; with one, it reports whether the gateway still
answers on its port.

Closes #19
This commit is contained in:
Christian Manivong committed 2026-11-02 10:58:14 +01:00
1 parent 5f0c7c76b3
commit e5ce4e32b1
5 files changed
+74 -5

No files matched your search

+5
View File
@@ -13,6 +13,11 @@ All notable changes to this driver. The format follows
3.12 venv no longer has.
### Fixed
- `is_alive()` returns `False` without touching the network when the driver has no
open session (never opened, or closed), and with an open session reports whether the
gateway still answers on its port (#19). It connected to the gateway in every case,
so each garbage-collected driver (NAPALM's `__del__` asks `is_alive()`) connected
once more and could stall for up to five seconds.
- A failed request to the gateway raises instead of reading as empty data (#15). A
timeout, a refused session or an HTTP error made `get_hosts`, `get_arp_table`,
`get_port_forwards`, `get_nat_translations`, `get_wireless_clients`, `get_ssids`,