fix: a failed listening-socket fallback raises (#11) #25

Merged
christianmanivong merged 1 commits from fix/bugs-2026-11 into main 2026-11-01 22:07:57 +00:00
Owner

A failed fallback read of the listening sockets now raises instead of reading as "nothing listens".

  • fix(sockets): when the root read fails, the fallback read runs through _read, which raises with the command's error on a non-zero exit.

Tested: fixtures only (TestListeningSockets::test_a_failed_fallback_raises_instead_of_reading_as_no_sockets, failed before the fix). pytest, ruff, mypy, napalm-standard check/ratchet green.

Closes #11

A failed fallback read of the listening sockets now raises instead of reading as "nothing listens". - `fix(sockets)`: when the root read fails, the fallback read runs through `_read`, which raises with the command's error on a non-zero exit. Tested: fixtures only (`TestListeningSockets::test_a_failed_fallback_raises_instead_of_reading_as_no_sockets`, failed before the fix). pytest, ruff, mypy, `napalm-standard check`/`ratchet` green. Closes #11
christianmanivong added 1 commit 2026-11-01 20:54:35 +00:00
fix(sockets): raise when the listening-socket fallback fails
driver / standard (pull_request) Successful in 19s
driver / lint (pull_request) Successful in 15s
driver / types (pull_request) Successful in 1m14s
driver / test (3.12) (pull_request) Successful in 1m18s
driver / test (3.13) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 33s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m17s
CI / driver (pull_request) Successful in 3m6s
driver / publish (pull_request) Skipped
a184a9cad1
When the root reading failed, get_listening_sockets ran the fallback
without root and parsed its output without looking at the exit status.
A failing sockstat or netstat returned an empty list, which a caller
reads as every port closed. The fallback now goes through the reader
check and raises with the command's error.

Closes #11
christianmanivong merged commit 8080ad1700 into main 2026-11-01 22:07:57 +00:00
christianmanivong deleted branch fix/bugs-2026-11 2026-11-01 22:07:57 +00:00
Sign in to join this conversation.