Skip to content

Commit

Permalink
Fix related names of NetmapView
Browse files Browse the repository at this point in the history
  • Loading branch information
johannaengland committed Sep 14, 2023
1 parent 25e4b32 commit 8b73c09
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions python/nav/netmap/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def _get_vlans_map_layer2(graph):
for swpv in SwPortVlan.objects.filter(
interface__in=list(interface_id_list)
).select_related():

vlan_by_interface[swpv.interface].append(swpv)

# unique storing on internal nav vlan id
Expand Down Expand Up @@ -136,7 +135,7 @@ def build_netmap_layer2_graph(
_logger.debug("build_netmap_layer2_graph() vlan metadata for _nodes_ done")

if view:
saved_views = view.node_position_set.all()
saved_views = view.node_positions.all()
netmap_graph = _attach_node_positions(netmap_graph, saved_views)
_logger.debug("build_netmap_layer2_graph() view positions and graph done")

Expand All @@ -161,7 +160,6 @@ def build_netmap_layer3_graph(topology_without_metadata, load_traffic=False, vie
# Make a copy of the graph, and add edge meta data
graph = nx.Graph()
for gwpp_u, gwpp_v, prefix in topology_without_metadata.edges(keys=True):

netbox_u = gwpp_u.interface.netbox
netbox_v = gwpp_v.interface.netbox

Expand Down Expand Up @@ -191,7 +189,7 @@ def build_netmap_layer3_graph(topology_without_metadata, load_traffic=False, vie
metadata[gwpp_u.prefix.vlan.id].append(additional_metadata)

if view:
graph = _attach_node_positions(graph, view.node_position_set.all())
graph = _attach_node_positions(graph, view.node_positions.all())
_logger.debug("build_netmap_layer3_graph() view positions and graph done")
return graph

Expand Down

0 comments on commit 8b73c09

Please sign in to comment.