helenyrwu
Committed by Gerrit Code Review

Fix disjoint path exceptions when backup not present

Change-Id: Ib8de79700f17a3b06e4b790064dc0c5625c77b38
......@@ -390,7 +390,11 @@ public class DefaultTopology extends AbstractModel implements Topology {
SUURBALLE.search(graph, srcV, dstV, weight, ALL_PATHS);
ImmutableSet.Builder<DisjointPath> builder = ImmutableSet.builder();
for (org.onlab.graph.Path<TopologyVertex, TopologyEdge> path : result.paths()) {
builder.add(networkDisjointPath((org.onlab.graph.DisjointPathPair<TopologyVertex, TopologyEdge>) path));
DisjointPath disjointPath =
networkDisjointPath((org.onlab.graph.DisjointPathPair<TopologyVertex, TopologyEdge>) path);
if (disjointPath.backup() != null) {
builder.add(disjointPath);
}
}
return builder.build();
}
......@@ -421,7 +425,11 @@ public class DefaultTopology extends AbstractModel implements Topology {
srlg.search(graph, srcV, dstV, weight, ALL_PATHS);
ImmutableSet.Builder<DisjointPath> builder = ImmutableSet.builder();
for (org.onlab.graph.Path<TopologyVertex, TopologyEdge> path : result.paths()) {
builder.add(networkDisjointPath((org.onlab.graph.DisjointPathPair<TopologyVertex, TopologyEdge>) path));
DisjointPath disjointPath =
networkDisjointPath((org.onlab.graph.DisjointPathPair<TopologyVertex, TopologyEdge>) path);
if (disjointPath.backup() != null) {
builder.add(disjointPath);
}
}
return builder.build();
}
......