From baf0ec72915b1290a0be284aab90b6ebdf057115 Mon Sep 17 00:00:00 2001 From: Alina Quereilhac Date: Wed, 3 Sep 2014 13:57:38 +0200 Subject: [PATCH] small bug fix in src/nepi/util/netgraph.py --- src/nepi/util/netgraph.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nepi/util/netgraph.py b/src/nepi/util/netgraph.py index 6d686226..c04f94df 100644 --- a/src/nepi/util/netgraph.py +++ b/src/nepi/util/netgraph.py @@ -19,6 +19,7 @@ import ipaddr import networkx +import math import random class TopologyType: @@ -325,8 +326,8 @@ class NetGraph(object): # The ladder is a special case because is not symmetric. if self.topo_type == TopologyType.LADDER: total_nodes = self.order/2 - leaf1 = str(total_nodes - 1) - leaf2 = str(nodes - 1) + leaf1 = str(total_nodes) + leaf2 = str(total_nodes - 1) leaves = [leaf1, leaf2] source = leaves.pop(random.randint(0, len(leaves) - 1)) else: -- 2.43.0