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

Kent Watsen <kent+ietf@watsen.net> Fri, 25 October 2019 16:26 UTC

Return-Path: <0100016e03bd94b3-8f7dc70c-8c60-405d-94bc-deece27152f7-000000@amazonses.watsen.net>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 126601208ED for <netmod@ietfa.amsl.com>; Fri, 25 Oct 2019 09:26:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazonses.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id za3NUFMcfZ79 for <netmod@ietfa.amsl.com>; Fri, 25 Oct 2019 09:26:28 -0700 (PDT)
Received: from a8-83.smtp-out.amazonses.com (a8-83.smtp-out.amazonses.com [54.240.8.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D3F891208EA for <netmod@ietf.org>; Fri, 25 Oct 2019 09:26:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1572020786; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=m2uD6FMLo7/Fb3qajW5q/caiAxLp3SGDMkpBGq0QCA8=; b=ZdycZGADNxd86zXUKb/fJp6Yu6YWNf5T4kqaaWrdLAphKvEAgkZhaPegyxghO7nN JBSvVU62mQ0LPgOlIzhVIMYK4gm67pPL7B10iDUP4Ip/tNczaV7WqyVS01awngoHs+I JLW1TMjjGJNaSsXuWPl6LhvMJrU7S5jSTSbpv8sk=
From: Kent Watsen <kent+ietf@watsen.net>
Message-ID: <0100016e03bd94b3-8f7dc70c-8c60-405d-94bc-deece27152f7-000000@email.amazonses.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_A1A1FDDC-704A-4836-BDB2-1DE81CE313F7"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Fri, 25 Oct 2019 16:26:26 +0000
In-Reply-To: <VI1PR0701MB2286421CCDA0D949E6A7E737F06A0@VI1PR0701MB2286.eurprd07.prod.outlook.com>
Cc: Edvardas Lasauskas <edvardas.lasauskas@ericsson.com>, Mark Hollmann <mark.hollmann@ericsson.com>, "netmod@ietf.org" <netmod@ietf.org>
To: =?utf-8?Q?Bal=C3=A1zs_Lengyel?= <balazs.lengyel=40ericsson.com@dmarc.ietf.org>
References: <VI1PR0701MB2286C5DA80832D166198EA65F0680@VI1PR0701MB2286.eurprd07.prod.outlook.com> <0100016df3e6091d-bf5947e5-0cd6-4a89-adf2-abbfb506ce01-000000@email.amazonses.com> <VI1PR0701MB2286421CCDA0D949E6A7E737F06A0@VI1PR0701MB2286.eurprd07.prod.outlook.com>
X-Mailer: Apple Mail (2.3445.104.11)
X-SES-Outgoing: 2019.10.25-54.240.8.83
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/T-AwaEBcwYz0mMcTb6o42KZiR2w>
Subject: Re: [netmod] Default statements and deviate add/replace
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 25 Oct 2019 16:26:30 -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=40ericsson.com@dmarc.ietf.org> wrote:
> 
> 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 <kent@watsen.net <mailto:kent@watsen.net>> 
> Sent: 2019. október 22., kedd 16:37
> To: Balázs Lengyel <balazs.lengyel@ericsson.com <mailto:balazs.lengyel@ericsson.com>>
> Cc: netmod@ietf.org <mailto:netmod@ietf.org>; Mark Hollmann <mark.hollmann@ericsson.com <mailto:mark.hollmann@ericsson.com>>; Edvardas Lasauskas <edvardas.lasauskas@ericsson.com <mailto:edvardas.lasauskas@ericsson.com>>
> 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 <balazs.lengyel=40ericsson.com@dmarc.ietf.org <mailto:balazs.lengyel=40ericsson.com@dmarc.ietf.org>> 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: Balazs.Lengyel@ericsson.com <mailto:Balazs.Lengyel@ericsson.com>
>  
> _______________________________________________
> netmod mailing list
> netmod@ietf.org <mailto:netmod@ietf.org>
> https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>
>  
> _______________________________________________
> netmod mailing list
> netmod@ietf.org <mailto:netmod@ietf.org>
> https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>