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

Unable to use prefix in augmention when argument inside submodule

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 7.0.0, 5.0.8, 6.0.2, 4.0.15
    • 4.0.14, 5.0.7, 6.0.1
    • parser

      Problem with using prefix inside a  when argument. This happens only inside a submodule trying to augment nodes from module to which it belongs.

      Example [1]:

      submodule ietf-snmp-community { 
        belongs-to ietf-snmp { 
          prefix snmp; 
        }
       ...
        augment /snmp:snmp/snmp:target { 
          when "snmp:v1 or snmp:v2c";
          ...
        }
      }
      

      Error message:

      Caused by: org.opendaylight.yangtools.yang.parser.spi.source.SourceException: Argument "snmp:v1 or snmp:v2c" is not valid XPath string [at experimental/ietf-extracted-YANG-modules/ietf-snmp-community@2014-05-06.yang:192:4]
      ...
      Caused by: javax.xml.xpath.XPathExpressionException: java.lang.IllegalArgumentException: Prefix snmp is not bound
      

      [1]https://github.com/YangModels/yang/blob/ac6e52f0574d8db59d3ca61f52b339f4a49ea09b/experimental/ietf-extracted-YANG-modules/ietf-snmp-community%402014-05-06.yang#L192

            rovarga Robert Varga
            martinbalaz Martin Balaz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: