Update core scanner, parser, SSH client, and UI
This commit is contained in:
+8
-1
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user