Subject: [netmod] ietf-yang-library conformance-type

From: Michal Vaško <[email-masked]>
Date: Mon, 02 May 2016 12:38:14 +0200

Hi,
during our ietf-yang-library module implementation, when we try to generate proper data tree with the correct information about a NETCONF server modules we encountered some problems.

Based on the descriptions of implement and import enum values we implemented module loading in the following way: every module explicitly loaded is implemented and every module imported from a different module is only imported. Naturally, a first-imported and them explicitly-loaded module can "upgrade" its conformance-type. We believed this to be the intended way of handling modules.

However, this may cause problems with deviations, augments, leafrefs, and possibly some other YANG statements. Most obvious inconsistency (if I understood everything well) is with leafref. To refer to a node in another module you only need to import this other module. But then you actually cannot see the data itself (they are "protocol-accessible objects"), which would force us to always mark target modules of leafrefs as implemented.

Similar problem occurs with augments and deviations. If a module with either of those is imported, the augments and deviation should not be applied. But, for instance, we can have modules A, B, and C. C imports A and B. B imports A and also augments it. Now it is reasonable for module C to expect the augment to be applied in A, since it imports both, but it will not be the case if they all are only imported. To solve this, modules with augments or deviations and their target modules could be required to be implemented. This could trigger recursive changes from import to implement in many modules.

My question is, was this intentional? Do I understand it correctly, what is the proper behavior? Thanks for a clarification.

Kind regards,
Michal Vasko

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 02 May 2016 12:49:33 +0200 (CEST)

Hi,

Michal Vaško <[email-masked]> wrote:
> Hi,
> during our ietf-yang-library module implementation, when we try to
> generate proper data tree with the correct information about a NETCONF
> server modules we encountered some problems.
> 
> Based on the descriptions of implement and import enum values we
> implemented module loading in the following way: every module
> explicitly loaded is implemented and every module imported from a
> different module is only imported. Naturally, a first-imported and
> them explicitly-loaded module can "upgrade" its conformance-type. We
> believed this to be the intended way of handling modules.
> 
> However, this may cause problems with deviations, augments, leafrefs,
> and possibly some other YANG statements. Most obvious inconsistency
> (if I understood everything well) is with leafref. To refer to a node
> in another module you only need to import this other module. But then
> you actually cannot see the data itself (they are "protocol-accessible
> objects"), which would force us to always mark target modules of
> leafrefs as implemented.

This is orthogonal to the usage of ietf-yang-library.  If a server
claims to implement a module with a leafref, the expected behavior is
that it also implements the target of that leafref.

> Similar problem occurs with augments and deviations. If a module with
> either of those is imported, the augments and deviation should not be
> applied. But, for instance, we can have modules A, B, and C. C imports
> A and B. B imports A and also augments it. Now it is reasonable for
> module C to expect the augment to be applied in A, since it imports
> both, but it will not be the case if they all are only imported. To
> solve this, modules with augments or deviations and their target
> modules could be required to be implemented. This could trigger
> recursive changes from import to implement in many modules.

It seems difficult to implement a module X that deviates Y without
implementing Y...  so if you want to phrase this as "implementing X
that deviates Y implies that you must implement Y" I guess that's ok.

> My question is, was this intentional? Do I understand it correctly,
> what is the proper behavior? Thanks for a clarification.

ietf-yang-library is supposed to simply report what the server
implements.  If the server implements a module Q with a leafref to W,
but it doesn't implement W, then ietf-yang-library shouldn't report W.

/martin