From: Robert Varga Date: Mon, 9 Jul 2018 10:53:50 +0000 (+0200) Subject: Remove unneeded check X-Git-Tag: release/fluorine~30 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=6706306c7894fc7400934768ef86fb55a46e1b87;p=netconf.git Remove unneeded check The size of the collection is checked before we allocate the transaction, hence conditional commit does not make sense. Change-Id: Iada5db72f2fcf51528c8b1791f2b5ae9d7f51c6a Signed-off-by: Robert Varga --- diff --git a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java index b71e423c4a..2d752489a1 100644 --- a/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java +++ b/netconf/callhome-provider/src/main/java/org/opendaylight/netconf/callhome/mount/IetfZeroTouchCallHomeServerProvider.java @@ -177,16 +177,12 @@ public class IetfZeroTouchCallHomeServerProvider implements AutoCloseable, DataT ReadWriteTransaction opTx = dataBroker.newReadWriteTransaction(); - int numRemoved = deletedDevices.size(); - for (InstanceIdentifier removedIID : deletedDevices) { LOG.info("Deleting the entry for callhome device {}", removedIID); opTx.delete(LogicalDatastoreType.OPERATIONAL, removedIID); } - if (numRemoved > 0) { - opTx.commit(); - } + opTx.commit(); } private static List getReadDevices(final ListenableFuture> devicesFuture)