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:
sam 2026-02-28 16:58:18 -07:00
parent 37b92c166a
commit a6180196e9
2 changed files with 2 additions and 2 deletions

View File

@ -1052,7 +1052,7 @@ def build_interface_entities(interfaces: dict, hostname: str, model: str,
name=name, name=name,
type=iface_type, type=iface_type,
enabled=iface_data.get("is_enabled", True), 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 speed=int(speed * 1000) if speed else 0, # NAPALM Mbps → NetBox Kbps
description=iface_data.get("description") or "", description=iface_data.get("description") or "",
tags=["network-collector"], tags=["network-collector"],

View File

@ -271,7 +271,7 @@ def build_interface_entities(hostname: str, interfaces: list[dict],
name=name, name=name,
type=_map_interface_type(pve_type, name), type=_map_interface_type(pve_type, name),
enabled=bool(iface.get("active", 0)), 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 "", description=", ".join(desc_parts)[:200] if desc_parts else "",
tags=["proxmox", "pbs"], tags=["proxmox", "pbs"],
))) )))