NETVIRT-1225 QOS bandwidth rule not pushed to ovs 72/71572/2
authorArun Sharma <arun.e.sharma@ericsson.com>
Mon, 30 Apr 2018 11:50:04 +0000 (17:20 +0530)
committerSam Hague <shague@redhat.com>
Tue, 1 May 2018 23:56:09 +0000 (23:56 +0000)
Root cause: Configuration fails because config change is not applied
            in child node if parent does not exist.

Fix: Use write config transaction 'merge' method instead of 'put'
     pass a flag to true to create the parent if does not exist.
     this flag is default false in case of 'put'

Change-Id: I0f1a1ae6c6eaf28719969998a7ac147c7be2c236
Signed-off-by: Arun Sharma <arun.e.sharma@ericsson.com>
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosNeutronUtils.java

index 1d90a3ea4aadc99d0266a83734f1da0dce3be6e9..a1d40d4dbeb6f2034a4f8b7fb5fe709ebeb8e9d3 100644 (file)
@@ -446,11 +446,11 @@ public class QosNeutronUtils {
         tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
         try {
             if (writeConfigTxn != null) {
-                writeConfigTxn.put(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier
+                writeConfigTxn.merge(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier
                         .create(NetworkTopology.class)
                         .child(Topology.class, new TopologyKey(SouthboundUtils.OVSDB_TOPOLOGY_ID))
                         .child(Node.class, bridgeNode.get().getKey())
-                        .child(TerminationPoint.class, new TerminationPointKey(tp.getKey())), tpBuilder.build());
+                        .child(TerminationPoint.class, new TerminationPointKey(tp.getKey())), tpBuilder.build(), true);
             } else {
                 MDSALUtil.syncUpdate(dataBroker, LogicalDatastoreType.CONFIGURATION, InstanceIdentifier
                         .create(NetworkTopology.class)