commit | 8c47efeaa5fac6e8ea8a2c3ed3ab70a7188193e7 | [log] [tgz] |
---|---|---|
author | Yuta HIGUCHI <y-higuchi@ak.jp.nec.com> | Wed Mar 29 19:25:24 2017 -0700 |
committer | Pier Luigi Ventre <pierluigi.ventre@cnit.it> | Wed Apr 12 10:00:57 2017 +0000 |
tree | 56af259d2fc51be746f9b79d59eab816d9ccae18 | |
parent | c8d8fc7d01fc8c484053aeda89406f7f273eca1e [diff] |
Make sure backup path satisfies constraints Change-Id: Ifbf4815dc86a1ad2dcc9314649925d018eb3bb8e
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ConnectivityIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ConnectivityIntentCompiler.java index 5ab65be..ceeeaa6 100644 --- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ConnectivityIntentCompiler.java +++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ConnectivityIntentCompiler.java
@@ -105,6 +105,9 @@ * @return true if the path passes all constraints */ protected boolean checkPath(Path path, List<Constraint> constraints) { + if (path == null) { + return false; + } for (Constraint constraint : constraints) { if (!constraint.validate(path, resourceService::isAvailable)) { return false; @@ -174,6 +177,7 @@ final List<Constraint> constraints = intent.constraints(); ImmutableList<DisjointPath> filtered = FluentIterable.from(paths) .filter(path -> checkPath(path, constraints)) + .filter(path -> checkPath(path.backup(), constraints)) .toList(); if (filtered.isEmpty()) { throw new PathNotFoundException(one, two);