From: wsx25289 <10200860@zte.com.cn> Date: Tue, 15 Oct 2019 08:01:30 +0000 (-0400) Subject: Fix config/oper reconciliation for leaf-lists X-Git-Tag: release/neon-sr3~6 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=netconf.git;a=commitdiff_plain;h=7ad160ecb0bbbb6ca812b443550e996950ed4993 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) --- 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());