aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/topology.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2020-03-11 12:46:44 +0100
committerVratko Polak <vrpolak@cisco.com>2020-03-17 15:59:28 +0000
commit11e9514af6e6d9e993b469fae3ce6671c3d3e536 (patch)
tree54169921ce49ebf6db03c47d6cec7b30aa6b42fa /resources/libraries/python/topology.py
parent54ff8d827f0aa3c689e26583952d04d86be503e7 (diff)
NodePath: Make path computation deterministic
In Python3, set operations seem to result in indeterministic order. + Remove verbose logging from topology.py Change-Id: I47cc90637a0b2969e1686b4216b7d8fe4fe2aaab Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/topology.py')
-rw-r--r--resources/libraries/python/topology.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/resources/libraries/python/topology.py b/resources/libraries/python/topology.py
index 7dec51619c..338ccb6b57 100644
--- a/resources/libraries/python/topology.py
+++ b/resources/libraries/python/topology.py
@@ -879,8 +879,6 @@ class Topology:
:rtype: list
"""
- logger.trace(f"node1: {str(node1)}")
- logger.trace(f"node2: {str(node2)}")
node1_links = self._get_node_active_link_names(
node1, filter_list=filter_list_node1
)
@@ -894,7 +892,10 @@ class Topology:
elif node2_links is None:
logger.error(u"Unable to find active links for node2")
else:
- connecting_links = list(set(node1_links).intersection(node2_links))
+ # Not using set operations, as we need deterministic order.
+ connecting_links = [
+ link for link in node1_links if link in node2_links
+ ]
return connecting_links