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

Extension argument is being restricted to identifier

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            pkajsa Peter Kajsa
            verthezpw Peter Verthez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: