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

Kent Watsen <kent@watsen.net> Tue, 22 October 2019 14:36 UTC

Return-Path: <0100016df3e6091d-bf5947e5-0cd6-4a89-adf2-abbfb506ce01-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 65CF3120086 for <netmod@ietfa.amsl.com>; Tue, 22 Oct 2019 07:36:45 -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 ImXRhw71yu5D for <netmod@ietfa.amsl.com>; Tue, 22 Oct 2019 07:36:44 -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 B680A120013 for <netmod@ietf.org>; Tue, 22 Oct 2019 07:36:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1571755002; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=4Qnrcb8X02Z/i/BDpS2pNd134y+qpIQLsMYjfZbSxnk=; b=MsIKbTu58JrsZ4w6/Lkv9yPtEkGPm4FtAUUMzk3aDr91NmCkPVYE0qRUDdX8E0Ch P8S0YrIIfiVGrm7MIsmHLRRaASQ6dz+ete6+JgfyvOn8msejt5DAfK3yDrZEx0z1fap ADWNtb7sE5isUo8VQiEnewZ9RJIfRVw6TScXREVU=
From: Kent Watsen <kent@watsen.net>
Message-ID: <0100016df3e6091d-bf5947e5-0cd6-4a89-adf2-abbfb506ce01-000000@email.amazonses.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_DCBB124A-3167-4634-B1C0-6D1CFCE465FA"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
Date: Tue, 22 Oct 2019 14:36:42 +0000
In-Reply-To: <VI1PR0701MB2286C5DA80832D166198EA65F0680@VI1PR0701MB2286.eurprd07.prod.outlook.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>, Mark Hollmann <mark.hollmann@ericsson.com>, Edvardas Lasauskas <edvardas.lasauskas@ericsson.com>
To: =?utf-8?Q?Bal=C3=A1zs_Lengyel?= <balazs.lengyel=40ericsson.com@dmarc.ietf.org>
References: <VI1PR0701MB2286C5DA80832D166198EA65F0680@VI1PR0701MB2286.eurprd07.prod.outlook.com>
X-Mailer: Apple Mail (2.3445.104.11)
X-SES-Outgoing: 2019.10.22-54.240.8.83
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/R2RjhFZAs9fP1MVdnPseINcV5zo>
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: Tue, 22 Oct 2019 14:36:45 -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=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>