[YANGTOOLS-661] Problem with nested typedefs Created: 21/Sep/16  Updated: 10/Apr/22  Resolved: 17/Oct/16

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

Type: Bug
Reporter: Peter Verthez Assignee: Peter Kajsa
Resolution: Done 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 typedef-bug.zip    
Issue Links:
Blocks
is blocked by YANGTOOLS-645 RpcEffectiveStatementImpl's construct... Resolved
External issue ID: 6771

 Description   

I've found 2 problems with nested typedefs. Both are exhibited by the attached model.

1) when a typedef is in a container that is in an augment, the YANG parser produces an error.

This can be seen in the attached model by uncommenting the leaf-container-b in typedef-bug.yang). The error produced is then:

...
Caused by: org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: Type [(http://www.example.com/typedef-bug?revision=2016-09-21)type-container-b] was not found. [at typedef-bug:35:14]
at org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException.throwIf(InferenceException.java:47)
at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.TypeStatementImpl$Definition$1.prerequisiteFailed(TypeStatementImpl.java:225)
at org.opendaylight.yangtools.yang.parser.stmt.reactor.ModifierImpl.failModifier(ModifierImpl.java:91)
at org.opendaylight.yangtools.yang.parser.stmt.reactor.SourceSpecificContext.failModifiers(SourceSpecificContext.java:290)

The equivalent definition without an augment is working fine (see the leaf-container-a in typedef-bug.yang).

2) Typedefs on RPCs are not returned by the ODL parser.

In the attached model, the definition of the rpc-a parses fine, but the getTypeDefinitions() method of the RpcDefinition is returning an empty list.

Note that this is on Beryllium-SR3. We haven't tried on Boron yet.



 Comments   
Comment by Peter Verthez [ 21/Sep/16 ]

Attachment typedef-bug.zip has been added with description: example model

Comment by Peter Kajsa [ 21/Sep/16 ]

2) This issue has been fixed in master and stable/boron branches (https://git.opendaylight.org/gerrit/#/c/44036/). So we will cherry-pick this fix also into stable/beryllium.

Comment by Peter Kajsa [ 28/Sep/16 ]

fix: https://git.opendaylight.org/gerrit/#/c/46223/

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