Added protection against no resources to PathIntentInstaller.
diff --git a/core/net/src/main/java/org/onlab/onos/net/intent/impl/PathIntentInstaller.java b/core/net/src/main/java/org/onlab/onos/net/intent/impl/PathIntentInstaller.java
index ad8ea08..c3b27bf 100644
--- a/core/net/src/main/java/org/onlab/onos/net/intent/impl/PathIntentInstaller.java
+++ b/core/net/src/main/java/org/onlab/onos/net/intent/impl/PathIntentInstaller.java
@@ -79,11 +79,14 @@
@Override
public List<FlowRuleBatchOperation> install(PathIntent intent) {
- LinkResourceAllocations allocations = allocateBandwidth(intent);
- if (allocations == null) {
- log.debug("Insufficient bandwidth available to install path intent {}", intent);
- return null;
+ if (intent.resourceRequests().length > 0) {
+ LinkResourceAllocations allocations = allocateBandwidth(intent);
+ if (allocations == null) {
+ log.debug("Insufficient bandwidth available to install path intent {}", intent);
+ return null;
+ }
}
+
TrafficSelector.Builder builder =
DefaultTrafficSelector.builder(intent.selector());
Iterator<Link> links = intent.path().links().iterator();