Dear NETMOD WG,

Some time ago I sent this email to the YANG doctors to check with them. I would 
also like to have your insights on mandatory augmented leaves.

We are working on a YANG module for the following draft: 
https://datatracker.ietf.org/doc/draft-tgraf-netconf-yang-notifications-versioning/
 
<https://datatracker.ietf.org/doc/draft-tgraf-netconf-yang-notifications-versioning/>
In this draft, we are augmenting a notification container in the YANG module 
adding new leaves.
We would like to have some of these leaves mandatories if the current YANG is 
used but are having an error code using the pyang compiler (error: cannot 
augment with mandatory node "revision-label”).

The resulting YANG tree without the mandatory statement is the following:
module: ietf-yang-push-metadata

  augment /yp:push-update:
    +--ro module?                     string
    +--ro namespace?                  string
    +--ro revision?                   rev:revision-date-or-label
    +--ro revision-label?             ysver:version
    +--ro datastore-xpath-filter?     yang:xpath1.0 {sn:xpath}?
    +--ro datastore-subtree-filter?    {sn:subtree}?
In RFC7950 Section 7.17, there is the following statement regarding the 
mandatory fields in augmented YANGs:

If the augmentation adds mandatory nodes (see Section 3 
<https://www.rfc-editor.org/rfc/rfc7950#section-3>) that
   represent configuration to a target node in another module, the
   augmentation MUST be made conditional with a "when" statement.  Care
   must be taken when defining the "when" expression so that clients
   that do not know about the augmenting module do not break.

Does this statement applies to YANG notification containers?
Or does this statement applies only to configuration YANG modules?
Is this a pyang compiler bug?

Regards,

Alex Huang Feng
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to