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

Fail to find unique argument node in augmented list

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 8.0.10, 9.0.6, 10.0.3
    • 10.0.1, 8.0.9, 9.0.5
    • parser
    • None

      Parser fails to find the argument node of a unique statement if a node is augmented to the list with the unique statement.

      For example, in the following example a node (foo-leaf) is augmented to the list (bar-list) with a unique statement (unique bar-leaf2;):

      module foo {
        namespace "urn:foo";
        prefix "foo";
      
        import bar {
          prefix bar;
        }
      
        container foo {
          uses bar:bar-group;
        }
      
        augment "/foo:foo/foo:bar-list" {
          leaf foo-leaf {
            type string;
          }
        }
      }
      
      module bar {
        namespace "urn:bar";
        prefix "bar";
        
        grouping bar-group {
          list bar-list {
            key bar-leaf1;
            unique bar-leaf2;
      
            leaf bar-leaf1 {
              type string;
            }
            leaf bar-leaf2 {
              type string;
            }
          }
        }
      }  
      

      and parser complains that the argument node bar-leaf2 does not exist.

      Caused by: org.opendaylight.yangtools.yang.parser.spi.source.SourceException: Following components of unique statement argument refer to non-existent nodes: [Descendant{qnames=[(urn:bar)bar-leaf2]}] [at /volumes/OpenDaylight/yangtools/parser/yang-parser-rfc7950/target/test-classes/bugs/YT1470/bar.yang:8:7]
      	at org.opendaylight.yangtools.yang.parser.rfc7950@10.0.2-SNAPSHOT/org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta.UniqueStatementSupport$RequireLeafDescendants.prerequisiteFailed(UniqueStatementSupport.java:201)
      	at org.opendaylight.yangtools.yang.parser.reactor@10.0.2-SNAPSHOT/org.opendaylight.yangtools.yang.parser.stmt.reactor.ModifierImpl.failModifier(ModifierImpl.java:86)
      	at org.opendaylight.yangtools.yang.parser.reactor@10.0.2-SNAPSHOT/org.opendaylight.yangtools.yang.parser.stmt.reactor.SourceSpecificContext.failModifiers(SourceSpecificContext.java:375)
      	at org.opendaylight.yangtools.yang.parser.reactor@10.0.2-SNAPSHOT/org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.addSourceExceptions(BuildGlobalContext.java:307)
      	... 50 more
      

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

              Created:
              Updated:
              Resolved: