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

YANG parser does not complain about invalid enum default after refining enum

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Duplicate
    • 2.0.10
    • None
    • parser
    • None

    Description

      We are using version 2.0.11.

      According to the YANG RFC https://tools.ietf.org/html/rfc7950#section-7.3.4 :

         If the type's default value is not valid according to the new
         restrictions specified in a derived type or leaf definition, the
         derived type or leaf definition MUST specify a new default value
         compatible with the restrictions.
      

      The YANG parser does not complain about this, see the example yang model attached to this ticket, which is parsed without error.

      For the same YANG model, pyang reports the following error:
      example.yang:16: error: the value "one" does not match its base type - enum not defined for the default value

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: