Improve global config application
[netconf.git] / netconf / callhome-provider / src / main / java / org / opendaylight / netconf / callhome / mount / CallHomeAuthProviderImpl.java
index 840dca1ffdee9baea59490135af263efb92a3541..9a345b02f3fe1e39ce8e1980fe0aa8f8484291a2 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.netconf.callhome.mount;
 
+import com.google.common.collect.Iterables;
 import com.google.common.net.InetAddresses;
 import java.io.IOException;
 import java.net.InetSocketAddress;
@@ -239,9 +240,9 @@ public class CallHomeAuthProviderImpl implements CallHomeAuthorizationProvider,
         private volatile Global current = null;
 
         @Override
-        public void onDataTreeChanged(@Nonnull final Collection<DataTreeModification<Global>> mods) {
-            for (DataTreeModification<Global> dataTreeModification : mods) {
-                current = dataTreeModification.getRootNode().getDataAfter();
+        public void onDataTreeChanged(final Collection<DataTreeModification<Global>> mods) {
+            if (!mods.isEmpty()) {
+                current = Iterables.getLast(mods).getRootNode().getDataAfter();
             }
         }