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

if-feature statements not correctly processed in refine

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 8922

      We have in one of the models of BBF the following case (see the attached model, which is similar but smaller):

      augment "/if:interfaces-state/if:interface" {
      if-feature availability;
      description
      "Augment the state data of an interface with operational status
      for availability. ";

      uses bbf-avail:availability {
      refine "availability"

      { description "Operational status defining the availability of an interface."; }

      }
      }

      The "availability" targeted by the refine is a container in the "bbf-avail:availability" grouping, which is marked by "if-feature availability".

      Now, if the "availability" feature is not present, and so the "availability" container in the "bbf-avail:availability" is not present, the above refine fails with the following error (the error is not present when the feature is present):

      Caused by: java.lang.IllegalArgumentException: Refine target node Relative

      {path=[(http://www.example.com/itf-availability?revision=2017-05-05)availability]}

      not found. At itf-availability:27:6
      at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
      at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.UsesStatementImpl.performRefine(UsesStatementImpl.java:297)
      at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.UsesStatementImpl.resolveUsesNode(UsesStatementImpl.java:273)
      at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.UsesStatementImpl$Definition$1.apply(UsesStatementImpl.java:113)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.ModifierImpl.applyAction(ModifierImpl.java:100)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.ModifierImpl.tryApply(ModifierImpl.java:160)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.SourceSpecificContext.tryToProgress(SourceSpecificContext.java:318)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.SourceSpecificContext.tryToCompletePhase(SourceSpecificContext.java:296)
      at org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext.completePhaseActions(BuildGlobalContext.java:359)
      ... 79 more

      However, the refine is also conditional under the same feature (if-feature on the surrounding augment), so this error looks incorrect to us.

            pkajsa Peter Kajsa
            verthezpw Peter Verthez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: