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

Deviation of augmented case node fails

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Done
    • 8.0.0, 7.0.14, 8.0.1
    • 7.0.15, 8.0.2
    • None
    • None

    Description

      Parsing of Yang sources with a deviated case node fails if the case node was created with augmentation without explicit case statement.

      For example, parsing of the following two modules fails.

      module orig {
          namespace "urn:orig";
          prefix orig;
      
          container foo {
              choice bar {
                  leaf bar1 {
                      type string;
                  }
              }
          }
      
          augment /foo/bar {
              leaf bar2 {
                  type string;
              }
          }
      }
      
      module deviate {
          namespace "urn:deviate";
          prefix dev;
      
          import orig {
              prefix orig;
          }
      
          deviation /orig:foo/orig:bar/orig:bar2 {
              deviate not-supported;
          }
      }
      

      Error message says that the case node is not found:

      16:34:32.334 [main] ERROR org.opendaylight.yangtools.yang.parser.stmt.reactor.            BuildGlobalContext - Failed to parse YANG from source SourceSpecificContext               [source=YangStatementStreamSource{identifier=RevisionSourceIdentifier [name=deviate]},    current=EFFECTIVE_MODEL, finished=FULL_DECLARATION]
      org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: Deviation target      'Absolute{qnames=[(urn:orig)foo, bar, bar2]}' not found. [at /root/OpenDaylight/yangtools/parser/yang-parser-rfc7950/target/test-classes/bugs/YT1408/aug-choice-deviate-case/       deviate.yang:9:5]
          at org.opendaylight.yangtools.yang.parser.rfc7950@8.0.2-SNAPSHOT/org.opendaylight.    yangtools.yang.parser.rfc7950.stmt.deviate.AbstractDeviateStatementSupport$1.             prerequisiteFailed(AbstractDeviateStatementSupport.java:175)
          at org.opendaylight.yangtools.yang.parser.reactor@8.0.2-SNAPSHOT/org.opendaylight.    yangtools.yang.parser.stmt.reactor.ModifierImpl.failModifier(ModifierImpl.java:87)
          at org.opendaylight.yangtools.yang.parser.reactor@8.0.2-SNAPSHOT/org.opendaylight.    yangtools.yang.parser.stmt.reactor.SourceSpecificContext.                                 failModifiers(SourceSpecificContext.java:383)
          at org.opendaylight.yangtools.yang.parser.reactor@8.0.2-SNAPSHOT/org.opendaylight.    yangtools.yang.parser.stmt.reactor.BuildGlobalContext.                                    addSourceExceptions(BuildGlobalContext.java:307)
          at org.opendaylight.yangtools.yang.parser.reactor@8.0.2-SNAPSHOT/org.opendaylight.    yangtools.yang.parser.stmt.reactor.BuildGlobalContext.                                    completePhaseActions(BuildGlobalContext.java:398)
          at org.opendaylight.yangtools.yang.parser.reactor@8.0.2-SNAPSHOT/org.opendaylight.    yangtools.yang.parser.stmt.reactor.BuildGlobalContext.executePhases(BuildGlobalContext.   java:199)
          at org.opendaylight.yangtools.yang.parser.reactor@8.0.2-SNAPSHOT/org.opendaylight.    yangtools.yang.parser.stmt.reactor.BuildGlobalContext.buildEffective(BuildGlobalContext.  java:210)
      

      Attachments

        # Subject Branch Project Status CR V

        Activity

          People

            rovarga Robert Varga
            sangwookha Sangwook Ha
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: