Init topology-netconf when clustered topology starts 36/32936/1
authorTomas Cere <tcere@cisco.com>
Mon, 18 Jan 2016 12:23:58 +0000 (13:23 +0100)
committerTomas Cere <tcere@cisco.com>
Mon, 18 Jan 2016 12:23:58 +0000 (13:23 +0100)
Change-Id: I527de936aeb88d58de5efa7dbd8463c38034dd2e
Signed-off-by: Tomas Cere <tcere@cisco.com>
opendaylight/netconf/netconf-topology/src/main/java/org/opendaylight/netconf/topology/impl/TopologyNodeWriter.java

index 54ef71f2b626ece1afadd55e6c5e8993a4324a67..b0a84a9e54d3a32c310fbeb11a580deb75b77b21 100644 (file)
@@ -69,6 +69,11 @@ public class TopologyNodeWriter implements NodeWriter{
 
         this.networkTopologyPath = InstanceIdentifier.builder(NetworkTopology.class).build();
         this.topologyListPath = networkTopologyPath.child(Topology.class, new TopologyKey(new TopologyId(topologyId)));
+
+        // write an empty topology container at the start
+        final WriteTransaction wTx = txChain.newWriteOnlyTransaction();
+        createNetworkTopologyIfNotPresent(wTx);
+        commitTransaction(wTx, "init topology container", new NodeId("topology-netconf"));
     }
 
     @Override