From c70b7e533c7735fe5c7eb155cd2a608d83cf20a8 Mon Sep 17 00:00:00 2001 From: Sithara Punnassery Date: Thu, 10 Aug 2017 14:28:08 -0700 Subject: [PATCH] ONOS-6906 Dynamic Config: Update events are missed Change-Id: Ibe8ac3936e1a0d868ac4952fecb0a39061ca343d --- .../config/impl/DistributedDynamicConfigStore.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java b/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java index 6fba8af7a7..b32364e771 100644 --- a/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java +++ b/apps/config/src/main/java/org/onosproject/config/impl/DistributedDynamicConfigStore.java @@ -197,9 +197,11 @@ public class DistributedDynamicConfigStore } private Boolean addKey(String path, DataNode.Type type) { - Boolean stat = false; - CompletableFuture ret = keystore.create(DocumentPath.from(path), type); - return complete(ret); + if (completeVersioned(keystore.get(DocumentPath.from(path))) != null) { + completeVersioned(keystore.set(DocumentPath.from(path), type)); + return true; + } + return complete(keystore.create(DocumentPath.from(path), type)); } @Override