[MDSAL-245] BI to BA conversion not resolving nested nodes Created: 18/Apr/17  Updated: 09/Mar/18  Resolved: 16/May/17

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

Type: Bug
Reporter: Jan Srnicek Assignee: Jakub Toth
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: Text File bi_to_ba_conversion_debug_log.txt    
External issue ID: 8237

 Description   

While converting following data

ImmutableContainerNode{
nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:hc:data?revision=2015-01-05)cont-under-list,
value= [
ImmutableContainerNode {
nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:hc:data?revision=2015-01-05)cont-under-list,
value= [
ImmutableLeafNode {
nodeIdentifier=(urn:opendaylight:params:xml:ns:yang:hc:data?revision=2015-01-05)nested-name,
value=nestedName,
attributes= {

}
}
],
attributes= {

}
}
],
attributes= {

}
}

with following logic

@Nonnull
default Map.Entry<InstanceIdentifier<? extends DataObject>, DataObject> nodeBinding(
@Nonnull final BindingToNormalizedNodeCodec serializer,
@Nonnull final YangInstanceIdentifier identifier,
@Nonnull final NormalizedNode<?, ?> data) {
try {
return serializer.toBinding(new AbstractMap.SimpleImmutableEntry<>(identifier, data))
.or(() ->

{ throw new IllegalArgumentException( String.format("Unable to create node binding for %s|%s", identifier, data)); }

);
} catch (DeserializationException e)

{ throw new IllegalArgumentException(String.format("Unable to deserialize node %s|%s", identifier, data)); }

}

The resulting data looks like

InstanceIdentifier{
targetType=interface org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.data.rev150105.simple.container.simple.list.ContUnderList,
path= [
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.data.rev150105.SimpleContainer,
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.data.rev150105.simple.container.SimpleList [
key=SimpleListKey [
_name=nameUnderSimpleList
]
],
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.data.rev150105.simple.container.simple.list.ContUnderList
]
}" -> "ContUnderList{ // here should be leaf as can be seen in BI data
augmentations= {

}
}"

ODL version used

<yangtools.version>1.0.3-Boron-SR3</yangtools.version>
<mdsal.version>2.1.3-Boron-SR3</mdsal.version>
<mdsal.controller.version>1.4.3-Boron-SR3</mdsal.controller.version>
<mdsalmodel.version>0.9.3-Boron-SR3</mdsalmodel.version>
<netconf.version>1.1.3-Boron-SR3</netconf.version>
<restconf.version>1.4.3-Boron-SR3</restconf.version>
<salGenerator.version>0.9.3-Boron-SR3</salGenerator.version>

Codec used org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec



 Comments   
Comment by Jan Srnicek [ 18/Apr/17 ]

Attachment bi_to_ba_conversion_debug_log.txt has been added with description: Debug log

Comment by Jan Srnicek [ 02/May/17 ]

Is somebody working on this one ?

Comment by Jakub Toth [ 16/May/17 ]

This is not bug, because you can reference only list or container. Leaf represents only "field" of referenced data objet.

I wrote test for this like example of use.

https://git.opendaylight.org/gerrit/#/c/57135/

Comment by Jan Srnicek [ 16/May/17 ]

The real issue is that value for leaf was not transformed from BI -> BA, i dont see what you mean by referencing leaf. Deserialization is invoked on container data that contains leaf, not on leaf data directly

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