From 6706306c7894fc7400934768ef86fb55a46e1b87 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 9 Jul 2018 12:53:50 +0200 Subject: [PATCH] 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 --- .../callhome/mount/IetfZeroTouchCallHomeServerProvider.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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) -- 2.36.6