mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 06:40:45 +08:00
Introduce workbench operations for multi-vendor NE CRUD/connect-test and Netmiko batch collection with job lifecycle controls, log downloads, and paginated run filters. Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
553 B
Python
17 lines
553 B
Python
"""Shared Netmiko helpers for managed NE connect/collect."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
def normalize_netmiko_device_type(device_type: str, protocol: str) -> str:
|
|
dt = str(device_type or "").strip()
|
|
proto = str(protocol or "ssh").strip().lower()
|
|
if "zte" in dt.lower():
|
|
if dt == "zte":
|
|
return f"zte_zxros_{proto}"
|
|
if "telnet" not in dt and "ssh" not in dt:
|
|
return f"{dt}_{proto}"
|
|
return dt
|
|
if "telnet" not in dt and "ssh" not in dt:
|
|
return f"{dt}_{proto}"
|
|
return dt
|