Subject: [netmod] Default statements and deviate add/replace

From: Balázs Lengyel <[email-masked]>
Date: Tue, 22 Oct 2019 10:56:08 +0000

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-masked]

---

From: Kent Watsen <[email-masked]>
Date: Tue, 22 Oct 2019 14:36:42 +0000

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 <balazs.lengyel=[email-masked]> wrote:
> 
> Hello, 
> 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:
> 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-masked] <mailto:[email-masked]>
>  
> _______________________________________________
> netmod mailing list
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>

---

From: Balázs Lengyel <[email-masked]>
Date: Thu, 24 Oct 2019 13:44:59 +0000

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-masked]> 
Sent: 2019. október 22., kedd 16:37
To: Balázs Lengyel <[email-masked]>
Cc: [email-masked]; Mark Hollmann <[email-masked]>; Edvardas Lasauskas <[email-masked]>
Subject: Re: [netmod] Default statements and deviate add/replace

Hi Balazs,

Kent

On Oct 22, 2019, at 6:56 AM, Balázs Lengyel <balazs.lengyel=[email-masked] <mailto:balazs.lengyel=[email-masked]> > wrote:

Hello, 

    deviate add {

      config false;     } }

    deviate add {

      min-elements 1;     }  }

Pyang 2.0.2 locally:

YANG-Validator yanglint

Regards Balazs

-- 

Mobile: +36-70-330-7909              email:  <mailto:[email-masked]> [email-masked]

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

---

From: Kent Watsen <[email-masked]>
Date: Fri, 25 Oct 2019 16:26:26 +0000

All,

While addressed to me, I was just seeking clarification on the ask.  Now that it is understood, could someone take a stab at a reply? 

FWIW, I don't have working experience with `deviate` and thus rather not reply.

Kent

> On Oct 24, 2019, at 9:44 AM, Balázs Lengyel <balazs.lengyel=[email-masked]> wrote:
> 
> Hello Kent,
> From: Kent Watsen <[email-masked] <mailto:[email-masked]>> 
> To: Balázs Lengyel <[email-masked] <mailto:[email-masked]>>
> Cc: [email-masked] <mailto:[email-masked]>; Mark Hollmann <[email-masked] <mailto:[email-masked]>>; Edvardas Lasauskas <[email-masked] <mailto:[email-masked]>>
> On Oct 22, 2019, at 6:56 AM, Balázs Lengyel <balazs.lengyel=[email-masked] <mailto:balazs.lengyel=[email-masked]>> wrote:
>  
> Hello,

---

From: "Rob Wilton (rwilton)" <[email-masked]>
Date: Tue, 29 Oct 2019 10:38:50 +0000

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

Hello Kent,

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

Hi Balazs,

Kent

On Oct 22, 2019, at 6:56 AM, Balázs Lengyel <balazs.lengyel=[email-masked]<mailto:balazs.lengyel=[email-masked]>> wrote:

Hello,

Pyang 2.0.2 locally:

YANG-Validator yanglint

Regards Balazs

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

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