[YANGTOOLS-1433] YangInstanceIdentifierWriter does not handle nested augmentations Created: 10/May/22 Updated: 10/May/22 Resolved: 10/May/22 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | data-api, data-impl |
| Affects Version/s: | 8.0.0, 8.0.3, 8.0.4 |
| Fix Version/s: | 9.0.0, 8.0.5 |
| Type: | Bug | Priority: | Highest |
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | regression | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
A failure reported in downstream boils down to incorrect handling of nested augmentations: Caused by: java.lang.IllegalArgumentException: Failed to convert /(urn:ietf:params:xml:ns:yang:ietf-network?revision=2018-02-26)networks/network/network[{(urn:ietf:params:xml:ns:yang:ietf-network?revision=2018-02-26)network-id=openroadm-topology}]/AugmentationIdentifier{childNames=[(urn:ietf:params:xml:ns:yang:ietf-network-topology?revision=2018-02-26)link]}/(urn:ietf:params:xml:ns:yang:ietf-network-topology?revision=2018-02-26)link/link[{(urn:ietf:params:xml:ns:yang:ietf-network-topology?revision=2018-02-26)link-id=ROADMA01-DEG1-DEG1-TTP-TXRXtoROADMC01-DEG2-DEG2-TTP-TXRX}]/AugmentationIdentifier{childNames=[(http://org/openroadm/network/topology?revision=2021-12-10)amplified, (http://org/openroadm/network/topology?revision=2021-12-10)OMS-attributes]}
at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.fromInstanceId(ImmutableNodes.java:226) ~[?:?]
at org.opendaylight.restconf.nb.rfc8040.rests.utils.TransactionUtil.ensureParentsByMerge(TransactionUtil.java:61) ~[?:?]
at org.opendaylight.restconf.nb.rfc8040.rests.transactions.MdsalRestconfTransaction.replace(MdsalRestconfTransaction.java:107) ~[?:?]
at org.opendaylight.restconf.nb.rfc8040.rests.utils.PutDataTransactionUtil.makePut(PutDataTransactionUtil.java:177) ~[?:?]
at org.opendaylight.restconf.nb.rfc8040.rests.utils.PutDataTransactionUtil.submitData(PutDataTransactionUtil.java:95) ~[?:?]
at org.opendaylight.restconf.nb.rfc8040.rests.utils.PutDataTransactionUtil.putData(PutDataTransactionUtil.java:70) ~[?:?]
at org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataServiceImpl.putData(RestconfDataServiceImpl.java:227) ~[?:?]
[...]
Caused by: java.io.IOException: Cannot find augmentation AugmentationIdentifier{childNames=[(http://org/openroadm/network/topology?revision=2021-12-10)amplified, (http://org/openroadm/network/topology?revision=2021-12-10)OMS-attributes]} in EmptyListEffectiveStatement{argument=(urn:ietf:params:xml:ns:yang:ietf-network-topology?revision=2018-02-26)link}
at org.opendaylight.yangtools.yang.data.api.schema.stream.YangInstanceIdentifierWriter.enterAugmentation(YangInstanceIdentifierWriter.java:265) ~[?:?]
at org.opendaylight.yangtools.yang.data.api.schema.stream.YangInstanceIdentifierWriter.open(YangInstanceIdentifierWriter.java:106) ~[?:?]
at org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes.fromInstanceId(ImmutableNodes.java:217) ~[?:?]
at org.opendaylight.restconf.nb.rfc8040.rests.utils.TransactionUtil.ensureParentsByMerge(TransactionUtil.java:61) ~[?:?]
The problem is that the resolution picks up the original manifestation augmentation rather than creating an EffectiveAugmentationSchema projection. Here 'link' is augmented into 'network' and then link is further augmented with OpenROADM attributes. During resolution we pick up the 'link' augmentation as declared in ietf-network-topology, not as effective in ietf-network instantiation – and that place knows nothing about openroadm. |