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

YANG parser does not complain about missing feature definition

XMLWordPrintable

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

      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

        1. example.yang
          0.2 kB
          Peter Verthez

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

              Created:
              Updated:
              Resolved: