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

YANG parser does not complain about missing feature definition

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Done
    • 2.0.10
    • 3.0.0, 2.0.17, 2.1.9
    • parser
    • None

    Description

      We are using version 2.0.11.

      The YANG parser does not complain if an "if-feature" statement refers to a feature that is not defined in the YANG model. See the example model attached: this parses without error.

      This should be an error according to https://tools.ietf.org/html/rfc7950#section-7.20.2 :

         If a prefix is present on a feature name in the boolean expression,
         the prefixed name refers to a feature defined in the module that was
         imported with that prefix, or the local module if the prefix matches
         the local module's prefix.  Otherwise, a feature with the matching
         name MUST be defined in the current module or an included submodule.
      

      pyang throws the following error for this:
      example.yang:9: error: feature "test-feature" not found in module example

      Attachments

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

        Activity

          People

            rovarga Robert Varga
            verthezpw Peter Verthez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: