Details
-
Bug
-
Status: Resolved
-
Resolution: Cannot Reproduce
-
None
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
4389
Description
When adding two augmentations to a node, data from the first augmentation does not get written to the data store.
Consider the attached models and the following code:
LOG.info("*** Writing a host node with TP");
List<TerminationPoint> tpList7 = new ArrayList<TerminationPoint>();
TpId tpId7 = new TpId("tp7");
tpList.add(new TerminationPointBuilder()
.setKey(new TerminationPointKey(tpId7))
.setTpId(tpId7)
.build());
Node1 node1_7 = new Node1Builder()
.setTerminationPoint(tpList7)
.build();
RemotePrefixKey ipPfxKey = new RemotePrefixKey(new IpPrefix("10.20.30.40/24".toCharArray()));
RemotePrefix remotePrefix = new RemotePrefixBuilder()
.setPrefix(ipPfxKey.getPrefix())
.setKey(ipPfxKey)
.build();
List<RemotePrefix> pfxList = new ArrayList<RemotePrefix>();
pfxList.add(remotePrefix);
NodeAttributes attr7 = new TypeHostBuilder()
.setRemotePrefix(pfxList)
.build();
Ofl3Node ofl3Node7 = new Ofl3NodeBuilder()
.setNodeAttributes(attr7)
.build();
NodeKey key7 = new NodeKey(new NodeId("hostNode7"));
Node node7 = new NodeBuilder()
.setKey(key7)
.addAugmentation(Node1.class, node1_7)
.addAugmentation(Ofl3Node.class, ofl3Node7)
.build();
WriteTransaction tx7 = dataBroker.newWriteOnlyTransaction();
InstanceIdentifier<Node> node_IID7 = NETWORK_IID.child(Node.class, key7);
tx7.put(LogicalDatastoreType.CONFIGURATION, node_IID7, node7, true);
try
{ tx7.submit().checkedGet(); } catch (TransactionCommitFailedException ex) {
LOG.error("Transaction failed: {}", ex.toString());
throw new RuntimeException(ex);
}
when looking at the data store through rest, i see the following data:
{
"network": [
{
"network-id": "test-network",
"node": [
{
"node-id": "hostNode7",
"ofl3-topology:remote-prefix": [
]
}
]
}
]
}
This problem appears in lithium