- final ReadWriteTransaction rwTx = mountpoint.newReadWriteTransaction();
- try {
- command.execute(rwTx);
- final CheckedFuture<Void, TransactionCommitFailedException> futureTask = rwTx.submit();
- futureTask.get();
- LOG.trace("Netconf DELETE transaction done. Retry counter: {}", retryCounter);
- return true;
- } catch (IllegalStateException e) {
- // Retry
- if (retryCounter > 0) {
- LOG.warn("Assuming that netconf delete-transaction failed, restarting ...", e.getMessage());
- return delete(mountpoint, command, --retryCounter);
- } else {
- LOG.warn("Netconf delete-transaction failed. Maximal number of attempts reached", e.getMessage());
- return false;
- }
- } catch (Exception e) {
- LOG.warn("Exception while removing data ...", e.getMessage());
- return false;
- }
+ InstanceIdentifier<Interface> iid = VppIidFactory.getInterfaceIID(command.getInterfaceBuilder().getKey());
+ return deleteIfExists(mountpoint, iid, retryCounter);