fix(config): read what retrieve asks in the REST-to-SSH fallback
driver / standard (pull_request) Successful in 18s
driver / lint (pull_request) Successful in 25s
driver / types (pull_request) Successful in 1m15s
driver / test (3.12) (pull_request) Successful in 1m8s
driver / test (3.13) (pull_request) Successful in 1m4s
driver / lowest (pull_request) Successful in 29s
driver / build (pull_request) Successful in 32s
driver / security (pull_request) Successful in 1m9s
CI / driver (pull_request) Successful in 2m54s
driver / publish (pull_request) Skipped

A switch whose REST API has no configuration is read over a temporary
SSH session. That path read the running config only, whatever retrieve
asked for, and returned an empty startup config. It now reads through
the same code as the SSH transport: running and/or startup as asked,
"show config" where "show startup-config" is unknown, and a part that
could not be read raises.

Closes #25
This commit is contained in:
Christian Manivong committed 2026-11-02 09:15:03 +01:00
1 parent f3da8944a3
commit e0ff997d1b
6 files changed
+141 -29

No files matched your search

+1 -1
View File
@@ -186,7 +186,7 @@ def test_get_config_raises_when_neither_rest_nor_ssh_reads_it():
def test_get_config_reads_over_ssh_when_the_firmware_has_no_config_resource():
driver = _rest_driver({"running-config": _response(404)})
ssh = MagicMock()
ssh = MagicMock(base_prompt="sw1")
ssh.send_command.return_value = "hostname sw1"
driver._ssh_connect = MagicMock(return_value=ssh)