[YANGTOOLS-924] Yang parser does not allow min-elements in deviate delete Created: 19/Dec/18 Updated: 07/Jan/19 Resolved: 01/Jan/19 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | parser |
| Affects Version/s: | 2.0.11, 2.1.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | Peter Verthez | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Description |
|
This is on release 2.0.11. When parsing the attached model, the following error occurs: Caused by: org.opendaylight.yangtools.yang.parser.spi.meta.InvalidSubstatementException: MIN_ELEMENTS is not valid for DEVIATE. Error in module testdev (QNameModule {ns=[http://example.com/testdev], rev=2018-08-14}) [at /home/verthezp/local/logs/deviate/testdev.yang:13:4]
Apparently the yang parser does not accept the min-elements statement in deviate delete (in deviate add and deviate replace it works fine). According to the RFC this seems to be a valid statement there, as long as it matches exactly what is in the target node of the deviation. This occurs both on yang 1.0 and yang 1.1.
|
| Comments |
| Comment by Robert Varga [ 19/Dec/18 ] |
|
It seems add/delete share different allowed statements, I am not sure why that is. |
| Comment by Robert Varga [ 01/Jan/19 ] |
|
While the text of RFC6020 or RFC7950 regarding "deviate" statement does not specifically exclude the substatements, the ABNF rule "deviate-delete-stmt" specifically excludes these statements: deviate-delete-stmt = deviate-keyword sep delete-keyword-str optsep
(";" /
"{" stmtsep
;; these stmts can appear in any order
[units-stmt]
*must-stmt
*unique-stmt
*default-stmt
"}") stmtsep
|
| Comment by Peter Verthez [ 07/Jan/19 ] |
|
OK, I had not noticed this, but I agree. |