From fe8df73ad67722c4ec56d284b60d7bab7dfc2024 Mon Sep 17 00:00:00 2001 From: Christian Manivong Date: Mon, 29 Jun 2026 15:05:34 +0200 Subject: [PATCH] fix(get_config): close REST session before SSH fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HP ProCurve switches allow only 1 session per user. The REST API session blocks SSH — closing it before the SSH attempt allows the connection. _collect_config() is called last so all poll data is already collected. --- napalm_procurve/procurve.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/napalm_procurve/procurve.py b/napalm_procurve/procurve.py index ce8b816..e264248 100644 --- a/napalm_procurve/procurve.py +++ b/napalm_procurve/procurve.py @@ -569,7 +569,12 @@ class ProcurveDriver(ConfigLifecycleMixin, SwitchDriver): if result.get("running"): return result # REST endpoint not available on this firmware (e.g. HP 2530 / YA series). - # Fall back to a temporary SSH connection to run show running-config. + # HP switches allow only one session per user — close the REST session + # first so the switch accepts the SSH connection. + try: + self._api._session.close() + except Exception: + pass running = self._get_config_via_ssh() return {"running": running, "startup": "", "candidate": ""}