fix(rest): raise on a failed REST read instead of returning {} #24

Merged
christianmanivong merged 1 commits from fix/bugs-2026-11-02 into main 2026-11-02 08:12:16 +00:00
1 Commits
Author SHA1 Message Date
Christian Manivong 628a827cbe fix(rest): raise on a failed REST read instead of returning {}
driver / standard (pull_request) Successful in 17s
driver / lint (pull_request) Successful in 13s
driver / types (pull_request) Successful in 1m14s
driver / test (3.12) (pull_request) Successful in 1m9s
driver / test (3.13) (pull_request) Successful in 1m10s
driver / lowest (pull_request) Successful in 30s
driver / build (pull_request) Successful in 33s
driver / security (pull_request) Successful in 1m10s
CI / driver (pull_request) Successful in 2m49s
driver / publish (pull_request) Skipped
ProcurveApiClient.get() answered {} for a timeout, a refused session or
any HTTP error, so every REST getter reported a failed read as a switch
with no hostname, ports, VLANs or neighbours. get() now raises
ConnectionException (no answer, 401/403) or RuntimeError (other
non-2xx, a body that is not JSON); the getters that expect a resource
to be missing on some firmware pass missing_ok for its 404.

get_config no longer returns an empty configuration when both the REST
read and the SSH fallback failed, and cli() over REST raises instead of
returning "Error: HTTP <status>" as the command's output.

Closes #22
2026-11-02 08:39:04 +01:00