fix network map

This commit is contained in:
Graham McIntire 2026-01-26 13:39:46 -06:00
parent 74f2970664
commit 492dc74c9a
No known key found for this signature in database

View file

@ -1721,7 +1721,12 @@ defmodule Towerops.Snmp do
defp build_node_lookup(devices, nodes) do
# Create maps for matching by different attributes
by_id = Map.new(nodes, &{&1.id, &1})
by_name = Map.new(nodes, &{String.downcase(&1.label), &1.id})
by_name =
nodes
|> Enum.filter(&(&1.label != nil))
|> Map.new(&{String.downcase(&1.label), &1.id})
by_ip = Map.new(nodes, fn node -> {node.ip_address, node.id} end)
# Build MAC address lookup from SNMP devices