Update core scanner, parser, SSH client, and UI

This commit is contained in:
2026-05-05 20:07:24 +00:00
parent 40d4679a59
commit d32ca80a22
6 changed files with 313 additions and 79 deletions
+8 -1
View File
@@ -6,6 +6,7 @@ from db import (
upsert_switch, upsert_link, clear_links,
log_scan_start, log_scan_finish, merge_duplicate_switches
)
from parser import parse_neighbor_description
from exports import run_all_exports
logger = logging.getLogger(__name__)
@@ -75,15 +76,21 @@ def run_scan(dept: str = None):
hostname=result["hostname"],
mgmt_ip=result["mgmt_ip"],
description=result.get("description", ""),
firmware=result.get("firmware", ""),
vendor=result.get("vendor", ""),
)
for neighbor in result["neighbors"]:
if neighbor.get("chassis_id") and neighbor.get("system_name"):
nbr_model, nbr_firmware = parse_neighbor_description(
neighbor.get("system_desc", "")
)
upsert_switch(
chassis_id=neighbor["chassis_id"],
hostname=neighbor["system_name"],
mgmt_ip=neighbor.get("mgmt_ip", ""),
description=neighbor.get("system_desc", ""),
description=nbr_model, # empty for FS neighbors; direct scan fills it in
firmware=nbr_firmware,
)
upsert_link(
chassis_a=result["chassis_id"],