package org.opendaylight.netvirt.elan.l2gw.ha.handlers;
import static org.opendaylight.genius.infra.Datastore.CONFIGURATION;
-import static org.opendaylight.mdsal.binding.api.WriteTransaction.CREATE_MISSING_PARENTS;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
//Also update the manager section in config which helps in cluster reboot scenarios
LoggingFutures.addErrorLogging(
txRunner.callWithNewWriteOnlyTransactionAndSubmit(CONFIGURATION,
- confTx -> haBuilder.getManagers().forEach(manager -> {
+ confTx -> haBuilder.getManagers().values().forEach(manager -> {
InstanceIdentifier<Managers> managerIid =
dstPath.augmentation(HwvtepGlobalAugmentation.class).child(Managers.class, manager.key());
- confTx.put(managerIid, manager, CREATE_MISSING_PARENTS);
+ confTx.mergeParentStructurePut(managerIid, manager);
})), LOG, "Error updating the manager section in config");
} else {
haNodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, haBuilder.build());
Node haNode = haNodeBuilder.build();
if (Operational.class.equals(datastoreType)) {
- tx.merge(dstPath, haNode, CREATE_MISSING_PARENTS);
+ tx.mergeParentStructureMerge(dstPath, haNode);
} else {
- tx.put(dstPath, haNode, CREATE_MISSING_PARENTS);
+ tx.mergeParentStructurePut(dstPath, haNode);
}
}
dstPsNodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, dstPsAugmentationBuilder.build());
Node dstPsNode = dstPsNodeBuilder.build();
- tx.merge(dstPsPath, dstPsNode, CREATE_MISSING_PARENTS);
+ tx.mergeParentStructureMerge(dstPsPath, dstPsNode);
LOG.debug("Copied {} physical switch node from {} to {}", datastoreType, srcPsPath, dstPsPath);
}