Skip to content
Snippets Groups Projects
Commit b663301f authored by Nikolay Stanchev's avatar Nikolay Stanchev
Browse files

Updates network topology builder to update latencies if an edge already existed

parent a4d7f11d
No related branches found
No related tags found
No related merge requests found
......@@ -389,7 +389,11 @@ def build_network_graph(graph, switches, links, clusters, ues):
new_switches_count += 1
# create the link between the two nodes
find_or_create_edge(graph, "linkedTo", from_node, to_node, latency=latency)
edge = find_or_create_edge(graph, "linkedTo", from_node, to_node, latency=latency)
if edge["latency"] != latency:
log.info("Updating latency for edge {0}, old latency {1}, new latency {2}".format(edge, edge["latency"], latency))
edge["latency"] = latency # make sure that the latency is updated if the edge already existed
graph.push(edge) # update the relationship in the DB
# check whether the source service router connects a particular cluster or a particular UE
if create_node_from_mapping(graph, from_node, source, clusters, "Cluster"):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment