Fix MTU=0 validation and create_message_chunks import errors
- Send mtu=None instead of mtu=0 (NetBox requires MTU >= 1) - Remove create_message_chunks usage (not in installed SDK version) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
37b92c166a
commit
a6180196e9
@ -1052,7 +1052,7 @@ def build_interface_entities(interfaces: dict, hostname: str, model: str,
|
||||
name=name,
|
||||
type=iface_type,
|
||||
enabled=iface_data.get("is_enabled", True),
|
||||
mtu=int(iface_data.get("mtu") or 0),
|
||||
mtu=int(iface_data["mtu"]) if iface_data.get("mtu") else None,
|
||||
speed=int(speed * 1000) if speed else 0, # NAPALM Mbps → NetBox Kbps
|
||||
description=iface_data.get("description") or "",
|
||||
tags=["network-collector"],
|
||||
|
||||
@ -271,7 +271,7 @@ def build_interface_entities(hostname: str, interfaces: list[dict],
|
||||
name=name,
|
||||
type=_map_interface_type(pve_type, name),
|
||||
enabled=bool(iface.get("active", 0)),
|
||||
mtu=iface.get("mtu"),
|
||||
mtu=int(iface["mtu"]) if iface.get("mtu") else None,
|
||||
description=", ".join(desc_parts)[:200] if desc_parts else "",
|
||||
tags=["proxmox", "pbs"],
|
||||
)))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user