import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
import org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
+import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev170119.L2vlan;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder;
* Interface is already created for parent NeutronPort. We're updating parent refs
* and VLAN Information
*/
- futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
- CONFIGURATION, tx -> {
- tx.merge(interfaceIdentifier, newIface);
- LOG.trace("Creating trunk member interface {}", newIface);
- }));
+ ListenableFuture<Void> future = txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ txn -> txn.merge(LogicalDatastoreType.CONFIGURATION, interfaceIdentifier, newIface));
+ ListenableFutures.addErrorLogging(future, LOG,
+ "createSubPortInterface: Failed for portName {}, parentName {}", portName, parentName);
+ futures.add(future);
return futures;
});
}
NeutronvpnUtils.buildVlanInterfaceIdentifier(subPort.getPortId().getValue());
jobCoordinator.enqueueJob("PORT- " + portName, () -> {
Interface iface = ifMgr.getInterfaceInfoFromConfigDataStore(portName);
+ List<ListenableFuture<Void>> futures = new ArrayList<>();
if (iface == null) {
LOG.warn("Interface not present for SubPort {}", subPort);
- return Collections.emptyList();
+ return futures;
}
/*
* We'll reset interface back to way it was? Can IFM handle parentRef delete?
* and this being subport delete path, don't expect any significant changes to
* corresponding Neutron Port. Deletion of NeutronPort should follow soon enough.
*/
- List<ListenableFuture<Void>> futures = new ArrayList<>();
futures.add(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
CONFIGURATION, tx -> {
tx.put(interfaceIdentifier, newIface);