alshabib
Committed by Gerrit Code Review

adding specified treatments when uninstalling intents

Change-Id: I4a200a6df9fce048321846c6df9b9e79457f7dfd
...@@ -123,8 +123,9 @@ public class PathIntentInstaller implements IntentInstaller<PathIntent> { ...@@ -123,8 +123,9 @@ public class PathIntentInstaller implements IntentInstaller<PathIntent> {
123 while (links.hasNext()) { 123 while (links.hasNext()) {
124 builder.matchInport(prev.port()); 124 builder.matchInport(prev.port());
125 Link link = links.next(); 125 Link link = links.next();
126 - TrafficTreatment treatment = builder() 126 + TrafficTreatment treatment = // if this is the last flow rule, apply the intent's treatments
127 - .setOutput(link.src().port()).build(); 127 + (links.hasNext() ? builder() : builder(intent.treatment()))
128 + .setOutput(link.src().port()).build();
128 FlowRule rule = new DefaultFlowRule(link.src().deviceId(), 129 FlowRule rule = new DefaultFlowRule(link.src().deviceId(),
129 builder.build(), treatment, 130 builder.build(), treatment,
130 123, appId, (short) (intent.id().fingerprint() & 0xffff), 0, true); 131 123, appId, (short) (intent.id().fingerprint() & 0xffff), 0, true);
......