Thomas Vachuska
Committed by Brian O'Connor

ONOS-2025 Corrected a logic error in the flow rule store that crept in during a …

…recent refactor. (175e8fde)

Change-Id: I4a4cb097ba7aa23dd00ebe59e8ebbbff68630dae
......@@ -412,16 +412,18 @@ public class NewDistributedFlowRuleStore
SERIALIZER::encode,
master)
.whenComplete((result, error) -> {
log.warn("Failed to storeBatch: {} to {}", operation, master);
Set<FlowRule> allFailures = operation.getOperations()
.stream()
.map(op -> op.target())
.collect(Collectors.toSet());
notifyDelegate(FlowRuleBatchEvent.completed(
new FlowRuleBatchRequest(operation.id(), Collections.emptySet()),
new CompletedBatchOperation(false, allFailures, deviceId)));
if (error != null) {
log.warn("Failed to storeBatch: {} to {}", operation, master);
Set<FlowRule> allFailures = operation.getOperations()
.stream()
.map(op -> op.target())
.collect(Collectors.toSet());
notifyDelegate(FlowRuleBatchEvent.completed(
new FlowRuleBatchRequest(operation.id(), Collections.emptySet()),
new CompletedBatchOperation(false, allFailures, deviceId)));
}
});
}
......