[YANGTOOLS-589] When condition of augment mistakenly added in constraints of augment target Created: 09/Mar/16 Updated: 10/Apr/22 Resolved: 11/Mar/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 |
||
| Attachments: |
|
| External issue ID: | 5481 |
| Description |
|
We are trying to migrate to the new parser in Beryllium, but we've found a bug that is blocking us from migrating. When a module augments a target conditionally in another module, the when condition of the augment is added in the constraints of the augment target, which is wrong. I've added a minimal example as attachment on this bug. When parsing this example, the result can be seen below (this is the output of a dumper that we wrote). The problem is the whenCondition in the getConstraints on the top container, which should not be there. (also, there are a number of maxElements values that seem to be wrong, but that is not blocking us) [ContainerEffectiveStatementImpl isAugmenting=false isAugmenting=false isAddedByUses=false getDefault=null getUnits=null getType= type=BaseStringType getQName=(urn:ietf:params:xml:ns:yang:1)string getUnits=null getDefaultValue=null getBaseType=null getLengthConstraints= getPatternConstraints= ] [LeafEffectiveStatementImpl getQName=(http://example.com/module2?revision=2016-03-09)extended-leaf isConfiguration=true getConstraints={mustConstraints=[], mandatory=false, minElements=0, maxElements=2147483647} isAugmenting=true |
| Comments |
| Comment by Peter Verthez [ 09/Mar/16 ] |
|
Attachment modules.zip has been added with description: Minimal example |
| Comment by Peter Kajsa [ 10/Mar/16 ] |
|
fix master: https://git.opendaylight.org/gerrit/#/c/36058/2 |