Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1433

YangInstanceIdentifierWriter does not handle nested augmentations

XMLWordPrintable

      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.

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: