Subject: [Netconf] YANG library bis model

From: Michal Vaško <[email-masked]>
Date: Fri, 26 Jan 2018 10:14:40 +0100

Hello,

we have tried implementing the YANG module [email-masked] from draft-ietf-netconf-rfc7895 and have encountered a problem. I am not completely certain that the issue is with the model and not our XPath evaluator, but based on the definitions I have found I believe the model is wrong.

   module: ietf-yang-library
     +--ro yang-library
        +--ro module-set* [name]
           +--ro module* [name]
              +--ro name         yang:yang-identifier
              +--ro deviation* [module]
                 +--ro module    -> ../../name

In the tree diagram (I have removed irrelevant parts) it can be seen that there is a "deviation" leafref that should point from one "module" list instance to another identifying the deviation module. So, the supposed evaluation should take the following steps: we start with leaf "module" we take ".." path so we get the "deviation" list. Then we take another ".." and we end up with all the "module" list instances. Finally, we try to find "name" leaf in all these instances of the "module" list.

However, our evaluator and some I have found online (all behaving according to XPath definition, I think) proceed differently. At the point of going one step up (parent node) into what es expected to be all the "module" list instances, the context node actually becomes only the *specific module list instance* we have started from, so when looking for the "name" leaf only the name of this list instance is taken into consideration. Needless to say, the evaluation never finds a matching "name" leaf because "module/name" and "module/deviation/module" should never match in one "module" list instance and so the validation always fails.

Kind regards,
Michal Vasko

---

From: Robert Wilton <[email-masked]>
Date: Fri, 26 Jan 2018 09:55:33 +0000

Hi Michal,

Thanks for raising this.

> However, our evaluator and some I have found online (all behaving according to XPath definition, I think) proceed differently. At the point of going one step up (parent node) into what es expected…
It looks like the leafref should be "../../../module/name".

Does that fix the issue for you?

Thanks,
Rob

> Kind regards,
> Michal Vasko
>
> _______________________________________________
> Netconf mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netconf
> .
>

---

From: Michal Vaško <[email-masked]>
Date: Fri, 26 Jan 2018 11:05:16 +0100

Hi Rob,

I have forgotten to mention that I have fixed it by modifying the leafref path the exact same way you proposed, it works fine that way.

Regards,
Michal

---

From: Robert Wilton <[email-masked]>
Date: Fri, 26 Jan 2018 10:29:05 +0000

Hi Michal,

I've fixed this in the latest draft.

Thanks again for pointing this out.
Rob