mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 14:10:44 +08:00
Improve WebCRT new-session flow for SecureCRT-like SSH/Telnet use.
Add quick-connect sessions with credential retry, raw interactive drivers, bootstrap banner replay, Huawei telnet prompt cleanup, and session rename/delete in the tree. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
accd28c9a1
commit
f6b399e03e
23 changed files with 3682 additions and 225 deletions
|
|
@ -54,6 +54,18 @@ def format_cli_failure(exc: BaseException | str, transcript: str = "", *, limit:
|
|||
"""Human/ops-facing failure message; promote auth rejects above Pattern/ReadTimeout."""
|
||||
if isinstance(exc, BaseException):
|
||||
exc_text = f"{type(exc).__name__}: {exc}"
|
||||
# Paramiko/Netmiko auth exceptions may carry little/no message text.
|
||||
try:
|
||||
import paramiko
|
||||
|
||||
if isinstance(exc, paramiko.AuthenticationException):
|
||||
detail = str(exc).strip() or type(exc).__name__
|
||||
return f"auth_rejected: {detail}"[:limit]
|
||||
except Exception:
|
||||
pass
|
||||
if "AuthenticationException" in type(exc).__name__:
|
||||
detail = str(exc).strip() or type(exc).__name__
|
||||
return f"auth_rejected: {detail}"[:limit]
|
||||
else:
|
||||
exc_text = str(exc or "")
|
||||
combined = f"{exc_text}\n{transcript or ''}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue