summaryrefslogtreecommitdiffstats
path: root/cps-service/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'cps-service/src/main')
-rw-r--r--cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java b/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java
index ea0626c2b2..cf79ad7e0b 100644
--- a/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java
+++ b/cps-service/src/main/java/org/onap/cps/spi/model/DataNodeBuilder.java
@@ -30,6 +30,7 @@ import java.util.Set;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.onap.cps.utils.YangUtils;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
import org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode;
import org.opendaylight.yangtools.yang.data.api.schema.LeafSetNode;
@@ -150,8 +151,10 @@ public class DataNodeBuilder {
}
private static void addYangContainer(final DataNode currentDataNode, final DataContainerNode<?> dataContainerNode) {
- final DataNode dataContainerDataNode = createAndAddChildDataNode(currentDataNode,
- YangUtils.buildXpath(dataContainerNode.getIdentifier()));
+ final DataNode dataContainerDataNode =
+ (dataContainerNode.getIdentifier() instanceof YangInstanceIdentifier.AugmentationIdentifier)
+ ? currentDataNode
+ : createAndAddChildDataNode(currentDataNode, YangUtils.buildXpath(dataContainerNode.getIdentifier()));
final Collection<DataContainerChild<?, ?>> normalizedChildNodes = dataContainerNode.getValue();
for (final NormalizedNode<?, ?> normalizedNode : normalizedChildNodes) {
addDataNodeFromNormalizedNode(dataContainerDataNode, normalizedNode);