diff --git a/napalm_procurve/procurve.py b/napalm_procurve/procurve.py index 3a8ff5f..833f6db 100644 --- a/napalm_procurve/procurve.py +++ b/napalm_procurve/procurve.py @@ -590,17 +590,26 @@ class ProcurveDriver(ConfigLifecycleMixin, SwitchDriver): """Open a one-shot SSH session to retrieve running-config. Used as fallback when the REST API does not expose the config endpoint - (e.g. HP 2530 / YA firmware). Returns empty string on any failure. + (e.g. HP 2530 / YA firmware with Mocana SSH). Tries legacy KEX + algorithms first (required for older ProCurve firmware), then standard. + Returns empty string on any failure. """ - try: - conn = ConnectHandler(**self._netmiko_kwargs()) + for legacy in (True, False): try: - return conn.send_command("show running-config") - finally: - conn.disconnect() - except Exception as exc: - logger.warning("SSH config fallback failed for %s: %s", self.hostname, exc) - return "" + conn = ConnectHandler(**self._netmiko_kwargs(legacy=legacy)) + try: + return conn.send_command("show running-config") + finally: + conn.disconnect() + except Exception as exc: + logger.debug( + "SSH config fallback (%s) failed for %s: %s", + "legacy" if legacy else "standard", + self.hostname, + exc, + ) + logger.warning("SSH config fallback failed for %s (all transports)", self.hostname) + return "" # ------------------------------------------------------------------ # NAPALM: get_environment