From 7ad160ecb0bbbb6ca812b443550e996950ed4993 Mon Sep 17 00:00:00 2001 From: wsx25289 <10200860@zte.com.cn> Date: Tue, 15 Oct 2019 04:01:30 -0400 Subject: [PATCH] Fix config/oper reconciliation for leaf-lists When config and operational datastore both have same data, then if we get data which has a leaf-list node by rests/data, it will fail, because there is no code to process leaf-list. Change-Id: I4724447158bf0a1a12e87145dcb361e8196b1170 Signed-off-by: Wsx25289 <10200860@zte.com.cn> (cherry picked from commit cf8760f55d752af8abafbf09d0f4f9116b9c753b) --- .../nb/rfc8040/rests/utils/ReadDataTransactionUtil.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/ReadDataTransactionUtil.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/ReadDataTransactionUtil.java index e162181f30..6fcdcdbb22 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/ReadDataTransactionUtil.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/ReadDataTransactionUtil.java @@ -648,6 +648,11 @@ public final class ReadDataTransactionUtil { mapValueToBuilder(((LeafSetNode) configDataNode).getValue(), ((LeafSetNode) stateDataNode).getValue(), builder); return builder.build(); + } else if (configDataNode instanceof LeafSetEntryNode) { + final NormalizedNodeBuilder> + builder = Builders.leafSetEntryBuilder().withNodeIdentifier(((LeafSetEntryNode) configDataNode) + .getIdentifier()).withValue(configDataNode.getValue()); + return builder.build(); } else if (configDataNode instanceof UnkeyedListNode) { final CollectionNodeBuilder builder = Builders .unkeyedListBuilder().withNodeIdentifier(((UnkeyedListNode) configDataNode).getIdentifier()); -- 2.36.6