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

Michael Rehder <Michael.Rehder@Amdocs.com> Fri, 12 October 2018 19:15 UTC

Return-Path: <Michael.Rehder@amdocs.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 06734130E7B for <netmod@ietfa.amsl.com>; Fri, 12 Oct 2018 12:15:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.779
X-Spam-Level:
X-Spam-Status: No, score=-1.779 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, T_DKIM_INVALID=0.01, T_KAM_HTML_FONT_INVALID=0.01] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=fail (1024-bit key) reason="fail (body has been altered)" header.d=amdocs.onmicrosoft.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 wYPVxJxVmXlM for <netmod@ietfa.amsl.com>; Fri, 12 Oct 2018 12:14:59 -0700 (PDT)
Received: from mx1.amdocs.com (ramail1.amdocs.com [193.43.244.133]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id ABC75130E82 for <netmod@ietf.org>; Fri, 12 Oct 2018 12:14:56 -0700 (PDT)
Received: from unknown (HELO ILHFDAGDRFE1.corp.amdocs.com) ([10.224.0.130]) by ilmail01.corp.amdocs.com with ESMTP; 12 Oct 2018 22:14:54 +0300
Received: from ILRNAEXCHCAS01.corp.amdocs.com (10.232.216.231) by ILHFDAGDRFE1 (10.237.240.44) with Microsoft SMTP Server (TLS) id 14.3.399.0; Fri, 12 Oct 2018 22:14:53 +0300
Received: from ILRNAEXCHCAS02.corp.amdocs.com (10.232.216.232) by ILRNAEXCHCAS01.corp.amdocs.com (10.232.216.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.845.34; Fri, 12 Oct 2018 22:14:53 +0300
Received: from ILRNAEXCHEDGE02.corp.amdocs.com (10.233.34.168) by ILRNAEXCHCAS02.corp.amdocs.com (10.232.216.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.845.34 via Frontend Transport; Fri, 12 Oct 2018 22:14:53 +0300
Received: from EUR04-VI1-obe.outbound.protection.outlook.com (192.168.34.8) by msgedge.amdocs.com (192.168.34.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.845.34; Fri, 12 Oct 2018 22:14:53 +0300
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Amdocs.onmicrosoft.com; s=selector1-amdocs-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xWv0rtBp70SPHGMRDKtGjhY8C25mMb9HGaWqwMrB5Zo=; b=d4VZvc0PEX+fKxT51TOJBamsk9bJiaA7SGYwJrvhiIfJElIKcNTpxDhzBM30/7p9GCT+zM/gefo3pRT1ShShf/OvuF1VTw5wTMZ+WqytTxCrkMyodMgpoUwJMZe4Vaockdb1xl1uK91Elc0/J/sAc8ZU0+rISphgky49R+0YRKg=
Received: from AM0PR06MB4083.eurprd06.prod.outlook.com (52.133.58.152) by AM0PR06MB3953.eurprd06.prod.outlook.com (52.133.57.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.23; Fri, 12 Oct 2018 19:14:51 +0000
Received: from AM0PR06MB4083.eurprd06.prod.outlook.com ([fe80::389e:ca21:ccc7:d6b1]) by AM0PR06MB4083.eurprd06.prod.outlook.com ([fe80::389e:ca21:ccc7:d6b1%5]) with mapi id 15.20.1228.020; Fri, 12 Oct 2018 19:14:51 +0000
From: Michael Rehder <Michael.Rehder@Amdocs.com>
To: Robert Wilton <rwilton@cisco.com>
CC: Andy Bierman <andy@yumaworks.com>, "Walker, Jason (Jason_Walker2@comcast.com)" <Jason_Walker2@comcast.com>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object
Thread-Index: AdRf+I5wQXpIeuYeT8uFcZ4kUETNSAArOyOAAAESuDAAATBXgAAAIxIgAAXi54AAAG/FwAAAei6AAAKI+5AALiXBgAAuGd8AAAATuoAAAMcsgAAFm1JQ
Date: Fri, 12 Oct 2018 19:14:51 +0000
Message-ID: <AM0PR06MB408379793AE9733A9F9FEC94E7E20@AM0PR06MB4083.eurprd06.prod.outlook.com>
References: <AM0PR06MB4083426FA0F1D3F6515F2ECFE7E70@AM0PR06MB4083.eurprd06.prod.outlook.com> <87zhvlvpts.fsf@nic.cz> <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> <884fca1e-7366-b7a6-c588-0e64b3d032a0@cisco.com>
In-Reply-To: <884fca1e-7366-b7a6-c588-0e64b3d032a0@cisco.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=Michael.Rehder@Amdocs.com;
x-originating-ip: [192.95.160.116]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; AM0PR06MB3953; 6:XlY5b+BeG7poG62TXzpJGk65WUOtz1Z5YvJ2XtLXPyX6men+hGgFRCiZqZVOBgNy+L61HK1ydvQoN1CzqdkDYgvv3sKgyiwYbhgbUMuD6eeod5ounq6vOf4UMzSHeDiA0AKxWWIelmUjZI6iuatSK3FLiON8wLwKzPetthV9o7Hn26i+Xdq7JJ+TXUdJVQXPjcWUNkJUgRvtBmEODhh1V+QDwxmFTdFFUpRO7cRvE6iRExlvbxyTzwYFRSTOcarqD879eGZVVG8oS72VPmKmgSLRrl9L4+/EoYiBncOECGiLuIK4jox/Z78JjNZK6hSjauOlRlt/Q+s1vaIRZlaMPRy/rAYB1/spIbP+nEZp4j3BdVjbXX/dsNSo7w7a5alQ6Ai7EXXh5b9fryXDPw+QgnwMEZ3UHGxM/+INqx9mSFfEU7G6ETbg2iOhEZRBLVWs72crRs/LCDXMtgPkX+85zw==; 5:VGKysSaAG62vI5ZwKSMJilvLbvLj6gOOiziU05Uz8q7bNjv2AKEBORb5KCkKJvRd+Zxec5tbQ11YejaPPckNcBoyljf1hcCvHi0HSZhi411eCdoq/DWK77Pso8vjT9+rN/WH9fK2lYjrdDs0+4LtsEsCcOkTXUuL+gP6SPDCklg=; 7:C2Nq7Ornqj5FHsR5qXxYiTX4SFZf1watKfahqm8DxrayTsTDUBNqEVVysmf7PwS9vzQnFJArxOnx12HhH2A2aNG1GZkI82YKxpANW/kuZ4vf9imI/HXVWP5OMXRFhRnTOV/BqKXxxqo5zwi0t48M+36w0i3rIoiyuO4bjCgGh5D6DBuJg32kpMM339+IdX8hBwE1HOCyXkTE/t320bbwT3+31DhqrPr9aUKs5VNGLPgQ6ZSlVbkzR8Kml3EN3W1B
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: 7deae242-34e9-41a9-262f-08d63076fc4c
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR06MB3953;
x-ms-traffictypediagnostic: AM0PR06MB3953:
x-microsoft-antispam-prvs: <AM0PR06MB3953052E1B695D4FD474D94FE7E20@AM0PR06MB3953.eurprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(95692535739014)(166566539817055)(62221491112393)(131327999870524)(21748063052155)(28532068793085)(190501279198761)(227612066756510);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991067); SRVR:AM0PR06MB3953; BCL:0; PCL:0; RULEID:; SRVR:AM0PR06MB3953;
x-forefront-prvs: 0823A5777B
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(376002)(136003)(366004)(396003)(199004)(189003)(51444003)(66066001)(4326008)(53546011)(93886005)(2906002)(54896002)(55016002)(71200400001)(71190400001)(6306002)(5250100002)(72206003)(97736004)(25786009)(81166006)(8936002)(476003)(486006)(8676002)(6246003)(7696005)(2900100001)(11346002)(446003)(81156014)(54906003)(316002)(99286004)(6116002)(790700001)(6506007)(478600001)(3846002)(76176011)(68736007)(6916009)(5660300001)(33656002)(7736002)(105586002)(74316002)(256004)(53936002)(86362001)(6436002)(186003)(102836004)(9686003)(236005)(229853002)(26005)(106356001)(14454004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR06MB3953; H:AM0PR06MB4083.eurprd06.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: Amdocs.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: GYOR8LiZ1d5TXvFgOsfCoKZ0KobFLSjECCh29MMSGV3Ky9UdPVVLAJO/ufYujXTxXViK13NxYoS88VrUBJWtyTbBez5kNmVv9QgulMLVIJ9Of3B1h2ngLmc+AZPkNM4+UzNC9K5d6v/JYlNgH7eb0CxPgvlqEqbu6H5wsIlz9Mma9wBB/Hd0Qgg2OozUy0CftLw7Q53MIS8At7DftCeCD9k8qZle3RL5k2suBfKsd9VX4a7IPHxXFzUKWmWZT/ifWDukFyux5mfNBBrorPr/f53x95SvI4726KlL9mNRNcsC8mJHUJZsojxXwF8Ck5Ai+efr9QfLUEKFzNbwGOi/hRdaHp8Pmy7ffa81HQxQj44=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_AM0PR06MB408379793AE9733A9F9FEC94E7E20AM0PR06MB4083eurp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 7deae242-34e9-41a9-262f-08d63076fc4c
X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2018 19:14:51.6276 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: c8eca3ca-1276-46d5-9d9d-a0f2a028920f
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR06MB3953
X-OriginatorOrg: amdocs.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/lHTgc7vcjnkE6oPPSsuxco4orOg>
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: Fri, 12 Oct 2018 19:15:02 -0000

I provided an example.
Requiring something to be present when a condition is to me a useful capability.
How else would you enforce in an optimal way that something is present under only certain conditions (define it on the controlled section, not use a zillion if-feature)?

Thanks
Mike

From: Robert Wilton [mailto:rwilton@cisco.com]
Sent: Friday, October 12, 2018 12:30 PM
To: Michael Rehder <Michael.Rehder@Amdocs.com>
Cc: Andy Bierman <andy@yumaworks.com>om>; Walker, Jason (Jason_Walker2@comcast.com) <Jason_Walker2@comcast.com>om>; netmod@ietf.org
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object


On 12/10/2018 17:08, Michael Rehder wrote:
The mandatory statement in that case is ignored (I’ve pointed out the RNG and Schematron lack of enforcement).
OK, I'm not familiar with RNG and Schematron.


WHEN trumps the mandatory status (via explicit mandatory or implicit mandatory via min-elements 1)
So I think that you are asking for mandatory to trump a when condition.  Can you provide a concrete example where this is required, or even useful?

A solution here, that doesn't require any changes in the YANG language, would be to just move the when condition, down to each of the child nodes that are not marked as mandatory.

But, sorry, at the moment I'm still at a loss to see how where this would actually be useful.

Thanks,
Rob



Thanks
Mike

From: Robert Wilton [mailto:rwilton@cisco.com]
Sent: Friday, October 12, 2018 12:06 PM
To: Michael Rehder <Michael.Rehder@Amdocs.com><mailto:Michael.Rehder@Amdocs.com>
Cc: Andy Bierman <andy@yumaworks.com><mailto:andy@yumaworks.com>; Walker, Jason (Jason_Walker2@comcast.com<mailto:Jason_Walker2@comcast.com>) <Jason_Walker2@comcast.com><mailto:Jason_Walker2@comcast.com>; netmod@ietf.org<mailto:netmod@ietf.org>
Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object


Hi Mike,

On 11/10/2018 19:05, Andy Bierman wrote:


On Thu, Oct 11, 2018 at 11:00 AM, Michael Rehder <Michael.Rehder@amdocs.com<mailto:Michael.Rehder@amdocs.com>> wrote:
I think the wording is relevant - something can be conditional but still required.
Yes, but I think that this is already expressed by a node that has both a when condition and mandatory statement.




container a {

  container x {

    when "some condition";

    leaf foo {

      mandatory true;

    }

    leaf bar {

      ...

    }

  }

  container y {

    leaf baz {

      mandatory true;

    }

    leaf tee {

      ...

    }

  }

}



a/x/foo is conditional (due to when) but required (if the when condition is met).

a/x/bar is conditional (due to when) but optional (if the when condition is met).

a/y/baz is unconditional but required.

a/y/tee is unconditional but optional.




It should be clarified that elements become implicitly “mandatory false” when a “when” statement is used.
But they don't.




I would like to see an enhancement to YANG to control this behavior, to allow the mandatory status to be enforced.
That is, support also “conditionally required” instead of only the current “conditionally optional”.
I'm trying to understand what this would even mean.

Taking your original example, but with "enforce-mandatory-status":

         leaf AssignmentMechanism {

            type enumeration {

              enum "DHCP";

              enum "Static";

            }

            mandatory true;

            description "The address assignment mechanism.";

          }

          list IPAddresses {

            when "../AssignmentMechanism = 'Static'" {

              enforce-mandatory-status;

            }  key Address;

            min-elements 1;



            leaf Address {

              type capit:IPv4Address;

              description "An ipv4 address.";

            }

           }

So this means that list IPaddresses must have at least one element regardless of whether the when condition holds.  I.e. no matter whether the assignment is DHCP or Static there must always be at least one 1 address configured.  But I don't understand what this actually means - it seems like a contradiction.  What am I missing?  Please can you give a concrete example (in YANG) of what behaviour you are looking for.

Thanks,
Rob

“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”.

“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”.