Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object

Robert Wilton <rwilton@cisco.com> Tue, 16 October 2018 13:41 UTC

Return-Path: <rwilton@cisco.com>
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 52369130DE4 for <netmod@ietfa.amsl.com>; Tue, 16 Oct 2018 06:41:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.501
X-Spam-Level:
X-Spam-Status: No, score=-14.501 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 NxhKRQc9Hn-D for <netmod@ietfa.amsl.com>; Tue, 16 Oct 2018 06:41:35 -0700 (PDT)
Received: from aer-iport-2.cisco.com (aer-iport-2.cisco.com [173.38.203.52]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 78D40130DE1 for <netmod@ietf.org>; Tue, 16 Oct 2018 06:41:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=8521; q=dns/txt; s=iport; t=1539697294; x=1540906894; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to; bh=F2TdxYsowfzTodnT6YX0JK80h8MYUbG7i2obBLWj0Jo=; b=lfnM+O7SyEVJKHidBD4cUrtbcYSOPpNGTgwmCWJGv/o9K0rr+EK4fMj1 0f96K9jb3eoRYebt5HSFm20kwDE9fDGG6zHTCCZVmBC8/hr/gjtEDFqrm bKraaPoBOxPCKxcllw/4gU0pTSOR3e4iTBe//o+dqXQohdDaN/NsBXmuH E=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0A+AAAu6cVb/xbLJq1gAxkBAQEBAQEBAQEBAQEHAQEBAQEBgWWBDYFdbRIog3WIdo1ckT+FXIFmDRgBCoQDRgKFBzgWAQMBAQIBAQJtHAyFOQEBAQECAQEBIUsLDAICCxABBAEBASMEAwICGwwfCQgGAQwGAgEBgxwBgXkID6YCgS4fhRuEYQUFi16BQT+BEieCa4MbAQGBLgELBwElGyaCPIJXAp4qCZBVBheBT4deJoZLj3aGN4FaIWRxMxoIGxU7gmyCToNphGGFPz4wiSwCDRcHgiABAQ
X-IronPort-AV: E=Sophos;i="5.54,388,1534809600"; d="scan'208,217";a="7285016"
Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-2.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2018 13:41:32 +0000
Received: from [10.63.23.63] (dhcp-ensft1-uk-vla370-10-63-23-63.cisco.com [10.63.23.63]) by aer-core-1.cisco.com (8.15.2/8.15.2) with ESMTP id w9GDfVtV026070; Tue, 16 Oct 2018 13:41:32 GMT
To: Michael Rehder <Michael.Rehder@Amdocs.com>, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Cc: "netmod@ietf.org" <netmod@ietf.org>
References: <AM0PR06MB40833D8AED0744BB597394E7E7E00@AM0PR06MB4083.eurprd06.prod.outlook.com> <d322e012-2767-a045-767a-ddf57649f36e@cisco.com> <AM0PR06MB4083B172F2424F1EEF08CFA0E7E00@AM0PR06MB4083.eurprd06.prod.outlook.com> <20181010182529.rhbu56qx4ogpb3st@anna.jacobs.jacobs-university.de> <AM0PR06MB4083AB058834759ECEA3FEEEE7E00@AM0PR06MB4083.eurprd06.prod.outlook.com> <CABCOCHQKz-S2jcqeoJCtuG9U0DxOOw4musJz4DzwEtbCrEjqYA@mail.gmail.com> <DB6PR06MB4085D91F66023AC98122FEDFE7E10@DB6PR06MB4085.eurprd06.prod.outlook.com> <CABCOCHRR92w3ouFmi6igg+AN=TM7BKfnaMiweOPxq_t9WTvvyg@mail.gmail.com> <7308ac7c-aa29-8a3d-a79a-5c70b8d3f5ef@cisco.com> <AM0PR06MB40839FD87E10433E10B4377CE7E20@AM0PR06MB4083.eurprd06.prod.outlook.com> <20181013211943.mpumhw5pflgq5tf3@anna.jacobs.jacobs-university.de> <AM0PR06MB4083C1601B887AEF73E616ADE7FE0@AM0PR06MB4083.eurprd06.prod.outlook.com>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <9d1627e3-8a0d-491e-1d2d-ed589e12b1c5@cisco.com>
Date: Tue, 16 Oct 2018 14:41:31 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <AM0PR06MB4083C1601B887AEF73E616ADE7FE0@AM0PR06MB4083.eurprd06.prod.outlook.com>
Content-Type: multipart/alternative; boundary="------------5352D69A5CA7578E7AD44A25"
Content-Language: en-US
X-Outbound-SMTP-Client: 10.63.23.63, dhcp-ensft1-uk-vla370-10-63-23-63.cisco.com
X-Outbound-Node: aer-core-1.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/p__EZ4FFKfTbi_kX88VFRTKpJvg>
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object
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, 16 Oct 2018 13:41:38 -0000

Hi Mike,


On 16/10/2018 14:26, Michael Rehder wrote:
> I've read rfc6110 and I didn't see any mention of "WHEN" on the mandatory status (section 9.1.1 Optional and Mandatory Nodes doesn't list it which seems a bit odd to me).
> The section on "WHEN" just mentions the xpath mapping, not anything about changing the mandatory status of the enclosing node.
>
> I still think that the YANG RFC wording of "conditional" needs to indicate if the node is mandatory status is affected or not.
> Note that rfc6060 "3.1 Mandatory Nodes" doesn't mention "WHEN" (it does mention presence).
By YANG RFC do you mean RFC 6020/7950?

Section 8.1 of RFC 7950 states the following constraints apply on valid 
data trees:

    o  There MUST be no nodes tagged with "when" present if the "when"
       condition evaluates to "false" in the data tree.

    o  The "mandatory" constraint is enforced for leafs and choices,
       unless the node or any of its ancestors has a "when" condition or
       "if-feature" expression that evaluates to "false".

    o  The "min-elements" and "max-elements" constraints are enforced for
       lists and leaf-lists, unless the node or any of its ancestors has
       a "when" condition or "if-feature" expression that evaluates to
       "false".

These rules indicate that "when" trumps "mandatory", "min-elements" and "max-elements".

Thanks,
Rob
  

>
> Thanks
> Mike
>> -----Original Message-----
>> From: Juergen Schoenwaelder [mailto:j.schoenwaelder@jacobs-university.de]
>> Sent: Saturday, October 13, 2018 5:20 PM
>> To: Michael Rehder <Michael.Rehder@Amdocs.com>
>> Cc: netmod@ietf.org
>> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't
>> ensure presence of the mandatory object
>>
>> On Fri, Oct 12, 2018 at 04:08:48PM +0000, Michael Rehder wrote:
>>
>>> The mandatory statement in that case is ignored (I’ve pointed out the
>>> RNG and Schematron lack of enforcement).  WHEN trumps the mandatory
>>> status (via explicit mandatory or implicit mandatory via min-elements
>>> 1)
>> Has the RNG and Schematron been obtained following RFC 6110? If so, this may
>> be a problem with RFC 6110 but not with YANG itself. There are validators that
>> do not use RNG or Schematron.
>>
>> /js
>>
>> --
>> Juergen Schoenwaelder           Jacobs University Bremen gGmbH
>> Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
>> Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>
> “Amdocs’ email platform is based on a third-party, worldwide, cloud-based system. Any emails sent to Amdocs will be processed and stored using such system and are accessible by third party providers of such system on a limited basis. Your sending of emails to Amdocs evidences your consent to the use of such system and such processing, storing and access”.
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod