import org.opendaylight.controller.md.sal.binding.api.DataTreeIdentifier;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.neutron.hostconfig.utils.NeutronHostconfigUtils;
import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
import org.opendaylight.ovsdb.utils.southbound.utils.SouthboundUtils;
this.neutronHostconfig = new NeutronHostconfigUtils(dataBroker);
}
- private void processChanges(Collection<DataTreeModification<Node>> changes) {
+ private void processChanges(Collection<DataTreeModification<Node>> changes)
+ throws TransactionCommitFailedException {
LOG.info("onDataTreeChanged: Received Data Tree Changed ...", changes);
for (DataTreeModification<Node> change : changes) {
final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
@Override
public void onDataTreeChanged(@Nonnull Collection<DataTreeModification<Node>> changes) {
Preconditions.checkNotNull(changes, "Changes may not be null!");
- processChanges(changes);
+ try {
+ processChanges(changes);
+ } catch (TransactionCommitFailedException e) {
+ LOG.error("Transaction commit failed; ignorining changes: ", changes, e);
+ }
}
private InstanceIdentifier<Node> createNodeIdentifier() {
}
}
- private void updateHostConfig(Node node, NeutronHostconfigUtils.Action action) {
+ private void updateHostConfig(Node node, NeutronHostconfigUtils.Action action)
+ throws TransactionCommitFailedException {
String hostId = getExternalId(node, OS_HOST_CONFIG_HOST_ID_KEY);
if (hostId == null) {
return;