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 { ...@@ -390,7 +390,11 @@ public class DefaultTopology extends AbstractModel implements Topology {
390 SUURBALLE.search(graph, srcV, dstV, weight, ALL_PATHS); 390 SUURBALLE.search(graph, srcV, dstV, weight, ALL_PATHS);
391 ImmutableSet.Builder<DisjointPath> builder = ImmutableSet.builder(); 391 ImmutableSet.Builder<DisjointPath> builder = ImmutableSet.builder();
392 for (org.onlab.graph.Path<TopologyVertex, TopologyEdge> path : result.paths()) { 392 for (org.onlab.graph.Path<TopologyVertex, TopologyEdge> path : result.paths()) {
393 - builder.add(networkDisjointPath((org.onlab.graph.DisjointPathPair<TopologyVertex, TopologyEdge>) path)); 393 + DisjointPath disjointPath =
394 + networkDisjointPath((org.onlab.graph.DisjointPathPair<TopologyVertex, TopologyEdge>) path);
395 + if (disjointPath.backup() != null) {
396 + builder.add(disjointPath);
397 + }
394 } 398 }
395 return builder.build(); 399 return builder.build();
396 } 400 }
...@@ -421,7 +425,11 @@ public class DefaultTopology extends AbstractModel implements Topology { ...@@ -421,7 +425,11 @@ public class DefaultTopology extends AbstractModel implements Topology {
421 srlg.search(graph, srcV, dstV, weight, ALL_PATHS); 425 srlg.search(graph, srcV, dstV, weight, ALL_PATHS);
422 ImmutableSet.Builder<DisjointPath> builder = ImmutableSet.builder(); 426 ImmutableSet.Builder<DisjointPath> builder = ImmutableSet.builder();
423 for (org.onlab.graph.Path<TopologyVertex, TopologyEdge> path : result.paths()) { 427 for (org.onlab.graph.Path<TopologyVertex, TopologyEdge> path : result.paths()) {
424 - builder.add(networkDisjointPath((org.onlab.graph.DisjointPathPair<TopologyVertex, TopologyEdge>) path)); 428 + DisjointPath disjointPath =
429 + networkDisjointPath((org.onlab.graph.DisjointPathPair<TopologyVertex, TopologyEdge>) path);
430 + if (disjointPath.backup() != null) {
431 + builder.add(disjointPath);
432 + }
425 } 433 }
426 return builder.build(); 434 return builder.build();
427 } 435 }
......