Saurav Das
Committed by Gerrit Code Review

Bug fix for Dell driver to use dummy group as flow-actions

Change-Id: I2ca81217ad8a51fe0f8f907a1befaa0fd947e40f
......@@ -1116,11 +1116,18 @@ public class SpringOpenTTP extends AbstractHandlerBehaviour
}
}
@SuppressWarnings("unused")
public GroupKey key() {
return key;
}
public boolean dummy() {
return dummy;
}
public TrafficTreatment treatment() {
return treatment;
}
@Override
public byte[] data() {
return appKryo.serialize(this);
......
......@@ -137,15 +137,26 @@ public class SpringOpenTTPDell extends SpringOpenTTP {
if (next != null) {
SpringOpenGroup soGroup = appKryo.deserialize(next.data());
Group group = groupService.getGroup(deviceId, soGroup.key());
if (group == null) {
log.warn("The group left!");
fail(fwd, ObjectiveError.GROUPMISSING);
return Collections.emptySet();
if (soGroup.dummy()) {
log.debug("Adding {} flow-actions for fwd. obj. {} -> next:{} "
+ "in dev: {}", soGroup.treatment().allInstructions().size(),
fwd.id(), fwd.nextId(), deviceId);
for (Instruction ins : soGroup.treatment().allInstructions()) {
treatmentBuilder.add(ins);
}
} else {
Group group = groupService.getGroup(deviceId, soGroup.key());
if (group == null) {
log.warn("The group left!");
fail(fwd, ObjectiveError.GROUPMISSING);
return Collections.emptySet();
}
treatmentBuilder.group(group.id());
log.debug("Adding OUTGROUP action to group:{} for fwd. obj. {} "
+ "for next:{} in dev: {}", group.id(), fwd.id(),
fwd.nextId(), deviceId);
}
treatmentBuilder.group(group.id());
log.debug("Adding OUTGROUP action");
} else {
log.warn("processSpecific: No associated next objective object");
fail(fwd, ObjectiveError.GROUPMISSING);
......