import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleFlags;
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.BundleId;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
}, MoreExecutors.directExecutor());
} else {
LOG.debug("Group {} not present in the config inventory", groupId);
- resultFuture = Futures.immediateFuture(RpcResultBuilder.<AddBundleMessagesOutput>success()
- .build());
+ resultFuture = Futures.immediateFuture(RpcResultBuilder.<AddBundleMessagesOutput>failed()
+ .withError(RpcError.ErrorType.APPLICATION,
+ "Group " + groupId + " not present in the config inventory").build());
}
} catch (InterruptedException | ExecutionException e) {
LOG.error("Error while reading group from config datastore for the group ID {}", groupId, e);
- resultFuture = Futures.immediateFuture(RpcResultBuilder.<AddBundleMessagesOutput>success().build());
+ resultFuture = Futures.immediateFuture(RpcResultBuilder.<AddBundleMessagesOutput>failed()
+ .withError(RpcError.ErrorType.APPLICATION,
+ "Group " + groupId + " not present in the config inventory").build());
}
}
} else {
}
}, MoreExecutors.directExecutor());
} else {
+ LOG.error("Error {} while pushing flow add bundle {} for device {}", rpcResult.getErrors(), messages,
+ nodeId.getValue());
resultFuture.set(rpcResult);
}
}
}, MoreExecutors.directExecutor());
/* Commit the bundle on the openflow switch */
- ListenableFuture<RpcResult<ControlBundleOutput>> commitBundleFuture
- = Futures.transformAsync(addbundlesFuture, rpcResult ->
- salBundleService.controlBundle(commitBundleInput), MoreExecutors.directExecutor());
+ ListenableFuture<RpcResult<ControlBundleOutput>> commitBundleFuture = Futures.transformAsync(
+ addbundlesFuture, rpcResult -> {
+ LOG.debug("Adding bundle messages completed for device {}", dpnId);
+ return salBundleService.controlBundle(commitBundleInput);
+ }, MoreExecutors.directExecutor());
/* Bundles not supported for meters */
List<Meter> meters = flowNode.get().getMeter() != null ? flowNode.get().getMeter()
OF_EVENT_LOG.debug("Bundle Reconciliation Finish, Node: {}", dpnId);
return true;
} else {
+ LOG.error("commit bundle failed for device {} with error {}", dpnId,
+ commitBundleFuture.get().getErrors());
return false;
}
} catch (InterruptedException | ExecutionException e) {