mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 23:20:51 +08:00
Fix WebCRT connect crash from invalid Netmiko session_log wrapper.
Use a BytesIO subclass for live connect echo so Netmiko accepts the log object again. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6ed08e24de
commit
6aedd2c522
3 changed files with 43 additions and 48 deletions
|
|
@ -19,6 +19,7 @@ from .ne_session_factory import (
|
|||
get_cli_hop_guard,
|
||||
open_netmiko_connection,
|
||||
)
|
||||
from .ne_session_connect import _ProgressBytesIO
|
||||
from .webcrt_channel import (
|
||||
_audit,
|
||||
_capture_raw_channel,
|
||||
|
|
@ -222,11 +223,12 @@ def _finish_connect(
|
|||
connect_timeout: int,
|
||||
client: str,
|
||||
) -> None:
|
||||
log_buf = io.BytesIO()
|
||||
|
||||
def _progress(text: str) -> None:
|
||||
sess.push_connect_echo(text)
|
||||
|
||||
# Must be BufferedIOBase subclass — Netmiko rejects custom log wrappers.
|
||||
log_buf = _ProgressBytesIO(_progress)
|
||||
|
||||
try:
|
||||
conn = open_netmiko_connection(
|
||||
creds,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue