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

Deviation must not target the same module as the one it is defined in

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Medium
    • Resolution: Unresolved
    • None
    • None
    • parser
    • None

    Description

      Hi,

      This is more like a query.

      Recently we found some yang files from our product team are failing the ODL parser. And the error is "Deviation must not target the same module as the one it is defined in".

      The root cause is obvious - they put some deviations in the same module they target.

      But the validators they are using do not report this kind of error.

      So we would like to know why ODL has this restriction? Is there any reference in RFC?

      The exception is thrown in yangtools/yang/parser/rfc7950/stmt/meta/DeviationStatementSupport.java

              final var targetModule = Iterables.getLast(ctx.getArgument().getNodeIdentifiers()).getModule();
              if (currentModule.equals(targetModule)) {
                  throw new InferenceException(ctx,
                          "Deviation must not target the same module as the one it is defined in: %s", currentModule);
              }

       

      Really appreciate your help. 

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            xiao.jing Xiao Jing
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: