I think that I basically agree with Balazs,  the spec refers to properties 
rather than sub-statements.

I would say, every data node always has these properties (either because they 
are required or because they have a defined default value if the statement is 
not present):
               config, mandatory, type
lists and leaf-lists also always have these properties (because they have 
default values if the statement is not present):
               max-elements, min-elements

So, I think that config, mandatory, type, max-elements, min-elements cannot be 
added or deleted, only replaced, because they always exist.

default, must, unique, units are all optional, and hence may be added, 
replaced, or deleted.

If we reach agreement, then I think that the text could also be clarified in 
YANG Next.

Thanks,
Rob


From: netmod <[email protected]> On Behalf Of Balázs Lengyel
Sent: 24 October 2019 14:45
To: Kent Watsen <[email protected]>
Cc: Edvardas Lasauskas <[email protected]>; Mark Hollmann 
<[email protected]>; [email protected]
Subject: Re: [netmod] Default statements and deviate add/replace

Hello Kent,
As IMO practically all tools are misbehaving I would like a confirmation that 
my interpretation of the differences between deviate add and deviate replace 
are correct.  After that I will start reporting the issues to the tools.
Regards Balazs

From: Kent Watsen <[email protected]<mailto:[email protected]>>
Sent: 2019. október 22., kedd 16:37
To: Balázs Lengyel 
<[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]>; Mark Hollmann 
<[email protected]<mailto:[email protected]>>; Edvardas 
Lasauskas 
<[email protected]<mailto:[email protected]>>
Subject: Re: [netmod] Default statements and deviate add/replace

Hi Balazs,

Is this for the NETMOD list, or should bugs be filed against the misbehaving 
tools?

Kent


On Oct 22, 2019, at 6:56 AM, Balázs Lengyel 
<[email protected]<mailto:[email protected]>>
 wrote:

Hello,
I tried testing the following statements:

  deviation /nacm:nacm/nacm:enable-nacm {
    deviate add {
      config false;     } }

  deviation /nacm:nacm/nacm:rule-list {
    deviate add {
      min-elements 1;     }  }

In nacm both the config and the min-elements are absent, so their default 
meaning is true. I actually tried both add and replace in deviate.
I got rather confusing results whether the add/replace variant of deviate 
should be accepted or rejected because the property already exists or does not 
yet exist.

Pyang 2.0.2 locally:
Config=false                       add-NOK              replace-OK
Min-elements=1              add-OK                 replace-NOK

YANG-Validator  pyang 2.0 & confdc
Config=false                       add-OK                 replace-OK
Min-elements=1              add-OK                 replace-NOK

YANG-Validator yanglint
Config=false                       add-OK                 replace-OK
Min-elements=1              add-OK                 replace-OK

IMHO the tools should always check the property, so even if the statement is 
not present the properties config=false and min-elements=0 ARE present. So add 
should be rejected and replace accepted.

Regards Balazs

--
Balazs Lengyel                    Senior Specialist                       
Ericsson Hungary Ltd.
Mobile: +36-70-330-7909              email: 
[email protected]<mailto:[email protected]>

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

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

Reply via email to