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

Fail to process deviation of augmented node without feature support

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Done
    • 8.0.9, 9.0.6, 10.0.3
    • 11.0.0, 8.0.10, 9.0.7, 10.0.5
    • parser

    Description

      Parsing of YANG models fails if a deviation statement targets a node conditionally augmented based on a feature and the feature is not supported.

      In the following example with two modules, foo & bar, parsing fails if foo-feature is not supported.

      foo.yang

      module foo {
        namespace "urn:foo";
        prefix "foo";
      
        feature foo-feature;
      
        container foo {
        }
      
        augment /foo:foo {
          if-feature foo-feature;
      
          leaf foo-leaf {
            type string;
          }
        }
      }
      

      bar.yang

      module bar {
        namespace "urn:bar";
        prefix "bar";
      
        import foo {
          prefix foo;
        }
      
        deviation /foo:foo/foo:foo-leaf {
         deviate not-supported;
        }
      }
      

      Parsing fails after trying to find the deviation target foo-leaf:

      Caused by: org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: Deviation target 'Absolute{qnames=[(urn:foo)foo, foo-leaf]}' not found. [at /volumes/OpenDaylight/yangtools/parser/yang-parser-rfc7950/target/test-classes/bugs/YT1485/augment/bar.yang:9:3]
      	at org.opendaylight.yangtools.yang.parser.rfc7950@10.0.4-SNAPSHOT/org.opendaylight.yangtools.yang.parser.rfc7950.stmt.deviate.AbstractDeviateStatementSupport$1.prerequisiteFailed(AbstractDeviateStatementSupport.java:167)
      	at org.opendaylight.yangtools.yang.parser.reactor@10.0.4-SNAPSHOT/org.opendaylight.yangtools.yang.parser.stmt.reactor.ModifierImpl.failModifier(ModifierImpl.java:86)
      	at org.opendaylight.yangtools.yang.parser.reactor@10.0.4-SNAPSHOT/org.opendaylight.yangtools.yang.parser.stmt.reactor.SourceSpecificContext.failModifiers(SourceSpecificContext.java:375)
      	at org.opendaylight.yangtools.yang.parser.reactor@10.0.4-SNAPSHOT/org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.addSourceExceptions(BuildGlobalContext.java:307)
      	... 80 more
      

      Attachments

        Issue Links

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

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: