[YANGTOOLS-752] Extension argument is being restricted to identifier Created: 28/Feb/17  Updated: 10/Apr/22  Resolved: 08/Mar/17

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


External issue ID: 7865

 Description   

We are testing with a SNAPSHOT of the Carbon release, to evaluate the YANG 1.1 support.

However, I think we found a regression compared to the previous release.

One of the models of the device we are managing contains the following use of an extension statement:

tailf:annotate "/if:interfaces-state/if:interface/bbf-fastdsl:line/bbf-fast:line/bbf-fast:performance/bbf-fast:intervals-15min/bbf-fast:current"

{ tailf:callpoint "fast-line-current-15-min-counter"; }

This was parsed successfully in Boron, but is now flagged in Carbon with:

java.lang.IllegalArgumentException: Parameter 'localName':'/if:interfaces-state/if:interface/bbf-fastdsl:line/bbf-fast:line/bbf-fast:performance/bbf-fast:intervals-15min/bbf-fast:current' contains illegal character ':'
at org.opendaylight.yangtools.yang.common.QName.checkLocalName(QName.java:104)
at org.opendaylight.yangtools.yang.common.QName.<init>(QName.java:82)
at org.opendaylight.yangtools.yang.common.QName.create(QName.java:235)
at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils.qNameFromArgument(Utils.java:486)
at org.opendaylight.yangtools.yang.parser.stmt.reactor.SubstatementContext.createSchemaPath(SubstatementContext.java:255)
at org.opendaylight.yangtools.yang.parser.stmt.reactor.SubstatementContext.getSchemaPath(SubstatementContext.java:281)
at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.UnknownEffectiveStatementImpl.<init>(UnknownEffectiveStatementImpl.java:42)
at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.UnknownStatementImpl$Definition.createEffective(UnknownStatementImpl.java:46)

It looks like ODL expects only an identifier here, but according to me that is not in line with the RFC, so this would be a bug in Carbon. Both the RFCs of YANG 1.0 and YANG 1.1 are saying:

;; represents the usage of an extension
unknown-statement = prefix ":" identifier [sep string] optsep
(";" /
"

{" optsep *((yang-stmt / unknown-statement) optsep) "}

") stmtsep

The [sep string] indicates according to me that the argument to the extension can be any string, so the model of our device is correct.



 Comments   
Comment by Peter Kajsa [ 08/Mar/17 ]

https://git.opendaylight.org/gerrit/#/c/52991/

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