X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnect%2Fnetconf%2FNetconfDeviceTwoPhaseCommitTransaction.java;h=a816819cb9eb1a2ee06426ffd390833a50f7250d;hp=216a27aaaa0afb39409d196b6ae5067a86ff23d8;hb=6fd408a04fe4a3611843e2246ece6d7c34b76903;hpb=d575edf655b58bb5aafd88c113ace7d41a813d7c diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java index 216a27aaaa..a816819cb9 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfDeviceTwoPhaseCommitTransaction.java @@ -1,6 +1,15 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ package org.opendaylight.controller.sal.connect.netconf; +import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.Map.Entry; import java.util.Set; @@ -90,19 +99,26 @@ public class NetconfDeviceTwoPhaseCommitTransaction implements DataCommitTransac for (PathArgument arg : reversed) { CompositeNodeBuilder builder = ImmutableCompositeNode.builder(); builder.setQName(arg.getNodeType()); - + Map predicates = Collections.emptyMap(); if (arg instanceof NodeIdentifierWithPredicates) { - for (Entry entry : ((NodeIdentifierWithPredicates) arg).getKeyValues().entrySet()) { - builder.addLeaf(entry.getKey(), entry.getValue()); - } + predicates = ((NodeIdentifierWithPredicates) arg).getKeyValues(); + } + for (Entry entry : predicates.entrySet()) { + builder.addLeaf(entry.getKey(), entry.getValue()); } + if (isLast) { if (action.isPresent()) { builder.setAttribute(NETCONF_ACTION_QNAME, action.get()); } if (lastChildOverride.isPresent()) { List> children = lastChildOverride.get().getChildren(); - builder.addAll(children); + for(Node child : children) { + if(!predicates.containsKey(child.getKey())) { + builder.add(child); + } + } + } } else { builder.add(previous);