Dear Netmod WG,

I created the issue on github on the pyang project regarding augmented 
notification containers with mandatory leaves.
https://github.com/mbj4668/pyang/issues/840 
<https://github.com/mbj4668/pyang/issues/840>

Regards,

Alex

> On 5 Dec 2022, at 11:02, Martin Björklund <[email protected]> wrote:
> 
> Hi,
> 
> Alex Huang Feng <[email protected] 
> <mailto:[email protected]>> wrote:
>> 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/>
>> <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 
>> <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?
> 
> It applies to configuration nodes.
> 
>> Is this a pyang compiler bug?
> 
> Yes.
> 
> 
> /martin
> 
> 
> 
>> 
>> Regards,
>> 
>> Alex Huang Feng

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

Reply via email to