[MDSAL-105] Binding-aware code: adding two augmentations to a node does not work Created: 01/Oct/15  Updated: 09/Mar/18  Resolved: 12/Jan/16

Status: Resolved
Project: mdsal
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Jan Medved Assignee: Igor Foltin
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive yang.zip    
External issue ID: 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": [

{ "prefix": "10.20.30.40/24" }

]
}
]
}
]
}

This problem appears in lithium



 Comments   
Comment by Jan Medved [ 01/Oct/15 ]

Attachment yang.zip has been added with description: yang models for the broken code

Comment by Igor Foltin [ 07/Jan/16 ]

This bug could not be replicated using the code in the comment above. After reading the node from the datastore, both augmentations were there.

I also could not replicate the bug using the following code - http://pastebin.com/V1gLDY2h.

Generated at Wed Feb 07 20:08:39 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.