Added protection against no resources to PathIntentInstaller.
Showing
1 changed file
with
3 additions
and
0 deletions
| ... | @@ -79,11 +79,14 @@ public class PathIntentInstaller implements IntentInstaller<PathIntent> { | ... | @@ -79,11 +79,14 @@ public class PathIntentInstaller implements IntentInstaller<PathIntent> { |
| 79 | 79 | ||
| 80 | @Override | 80 | @Override |
| 81 | public List<FlowRuleBatchOperation> install(PathIntent intent) { | 81 | public List<FlowRuleBatchOperation> install(PathIntent intent) { |
| 82 | + if (intent.resourceRequests().length > 0) { | ||
| 82 | LinkResourceAllocations allocations = allocateBandwidth(intent); | 83 | LinkResourceAllocations allocations = allocateBandwidth(intent); |
| 83 | if (allocations == null) { | 84 | if (allocations == null) { |
| 84 | log.debug("Insufficient bandwidth available to install path intent {}", intent); | 85 | log.debug("Insufficient bandwidth available to install path intent {}", intent); |
| 85 | return null; | 86 | return null; |
| 86 | } | 87 | } |
| 88 | + } | ||
| 89 | + | ||
| 87 | TrafficSelector.Builder builder = | 90 | TrafficSelector.Builder builder = |
| 88 | DefaultTrafficSelector.builder(intent.selector()); | 91 | DefaultTrafficSelector.builder(intent.selector()); |
| 89 | Iterator<Link> links = intent.path().links().iterator(); | 92 | Iterator<Link> links = intent.path().links().iterator(); | ... | ... |
-
Please register or login to post a comment