From a51d7a4e316e0e4dd14df037124755acda032a8a Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Thu, 10 Apr 2025 13:28:34 -0500 Subject: [PATCH] Candidate fix: this *should* implement the promotion. --- src/integrationCommon.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/integrationCommon.py b/src/integrationCommon.py index f546f50c..48c7343c 100644 --- a/src/integrationCommon.py +++ b/src/integrationCommon.py @@ -5,7 +5,7 @@ from typing import List, Any from liblqos_python import allowed_subnets, ignore_subnets, generated_pn_download_mbps, generated_pn_upload_mbps, \ circuit_name_use_address, upstream_bandwidth_capacity_download_mbps, upstream_bandwidth_capacity_upload_mbps, \ find_ipv6_using_mikrotik, exclude_sites, bandwidth_overhead_factor, committed_bandwidth_multiplier, \ - exception_cpes + exception_cpes, promote_to_root_list import ipaddress import enum import os @@ -186,7 +186,13 @@ class NetworkGraph: for child in self.nodes: if child.parentId != "": for (i, node) in enumerate(self.nodes): - if node.id == child.parentId: + # If the node is in `promote_to_root_list`, the parent for + # the node is set to 0, which is the root node. Otherwise, + # the parent is set to the node with the same id as the + # parentId of the child node. + if child.parentId in promote_to_root_list(): + child.parentIndex = 0 + elif node.id == child.parentId: child.parentIndex = i def findNodeIndexById(self, id: str) -> int: -- knotmirror 0.0.1