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

Michael Rehder <Michael.Rehder@Amdocs.com> Tue, 09 October 2018 17:51 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 0F65D130E89 for <netmod@ietfa.amsl.com>; Tue, 9 Oct 2018 10:51:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.789
X-Spam-Level:
X-Spam-Status: No, score=-1.789 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] 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 vBzLawClFPl3 for <netmod@ietfa.amsl.com>; Tue, 9 Oct 2018 10:51:27 -0700 (PDT)
Received: from mx3.amdocs.com (ramail2.amdocs.com [193.43.244.136]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 44E15130E83 for <netmod@ietf.org>; Tue, 9 Oct 2018 10:51:26 -0700 (PDT)
Received: from unknown (HELO ILHFDAGDRFE4.corp.amdocs.com) ([10.224.0.130]) by ilmail02.corp.amdocs.com with ESMTP; 09 Oct 2018 20:51:23 +0300
Received: from ILRNAEXCHCAS02.corp.amdocs.com (10.232.216.232) by ILHFDAGDRFE4.corp.amdocs.com (10.237.241.95) with Microsoft SMTP Server (TLS) id 14.3.399.0; Tue, 9 Oct 2018 20:51:23 +0300
Received: from ILRNAEXCHCAS02.corp.amdocs.com (10.232.216.232) 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; Tue, 9 Oct 2018 20:51:22 +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; Tue, 9 Oct 2018 20:51:22 +0300
Received: from EUR01-DB5-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_CBC_SHA384) id 15.1.845.34; Tue, 9 Oct 2018 20:51:22 +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=uhdhXe9hGch1O28a5nY1zUIm0gUETjh3LSwVh5xm2Gw=; b=rKIjHWLAG23CU/4m6wG4L/IOIWd0IRCNaHAs8RY9CQUFagQiR01jYthyVdUwRzBz4xtCdjqE0ILIFGrKLjo9LTncB4gTXK8fo/24ALj1+02rGtvLtumyKtOjJY3/F3KY1sYAWz8Roh1hBK8/sXZ7wtHuxQJ+tdn55dx+A+WGKyc=
Received: from AM0PR06MB4083.eurprd06.prod.outlook.com (52.133.58.152) by AM0PR06MB4385.eurprd06.prod.outlook.com (20.176.214.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.26; Tue, 9 Oct 2018 17:51:20 +0000
Received: from AM0PR06MB4083.eurprd06.prod.outlook.com ([fe80::389e:ca21:ccc7:d6b1]) by AM0PR06MB4083.eurprd06.prod.outlook.com ([fe80::389e:ca21:ccc7:d6b1%3]) with mapi id 15.20.1207.024; Tue, 9 Oct 2018 17:51:20 +0000
From: Michael Rehder <Michael.Rehder@Amdocs.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: WHEN statement within mandatory objects doesn't ensure presence of the mandatory object
Thread-Index: AdRf+I5wQXpIeuYeT8uFcZ4kUETNSA==
Date: Tue, 09 Oct 2018 17:51:20 +0000
Message-ID: <AM0PR06MB4083426FA0F1D3F6515F2ECFE7E70@AM0PR06MB4083.eurprd06.prod.outlook.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; AM0PR06MB4385; 6:BF0igHsq5jGv6Mm3i+fKzQ6nF/X6H2LLE9XkhQnrUuOhFzBmOw8Gt0pd8TVWCW3ZkqssHnns0Wq0Jhqrzr8YJv5HN1OGKhXva0VYwj4PFzzSNlc9ptnmkvD9L8KHjsAg/grgqX6XkwMFhWRu64Z4tdteTfW6VKPfPoIvC8oBW25FMXSK0Sw5qc1hVmRUdxYgAsJRjLlEqqbLoqR/jcdQMgMB51F2I8hKnlA437wgayk/PkHP2/xLEOEbuV/l+w2snBJg0RbmenEOk+a8E8G7vhx9xFDSqus7A4zJeJ7Yuk0Zj6r6O5dmEyvh9RO98gX8uwWQ//OU2ogWW2jJlpnl6AIEbljsDGXncrMhLRKj47eC24E+/jWKeId0A9BW/KG6TvcAwj483kbAm+p8ymp7j0UVg9j3weYkEjjEo5b2NK1ccZpX8lLnHgL4rhieGerYpXxwyjp/PZYPUfICDLiDSg==; 5:/73ytvj6IMQone78sI13X8clEv8QzdQnFlcOLUHmVdoNbQS2JKM3+ViI5VQmZon+lufUdPC+d6hOT70aKIqfKVOC3RjY8jLvdCEbG5CQsFiLdxMWvAOKE+LCAIBXj/F6+WX25DSf/suhx4TjHkNLu0gOpU8rAVFpkAhNa9VUWDw=; 7:haE1XcmtsE9GnGmicFWOk8C5SqgHoahy7+VIOb1+dDYGixFBh2J50MCgTzGT96wd5gMRP9avvRIQu/yCupu9c1GtSa+J0G7yVOjobJcN8lOEli2mr3nufRiYd4cOnOXB6SNFobHol+FU7BFV6gVsDjR6IffSbn2BE+5+Qs/ejimQmdhWwfKJnO9mye+89zqushlIyQ1DhWrqxZ/Kj8IydSHadQl9nphPJpwrvR3V8rKUoQtj4eY7X8bBq/UkH5Nl
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: 30b7794b-0540-42d6-af64-08d62e0fd259
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR06MB4385;
x-ms-traffictypediagnostic: AM0PR06MB4385:
x-microsoft-antispam-prvs: <AM0PR06MB4385E667279072E06BC7B573E7E70@AM0PR06MB4385.eurprd06.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(21748063052155)(28532068793085)(190501279198761)(227612066756510);
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201708071742011)(7699051)(76991055); SRVR:AM0PR06MB4385; BCL:0; PCL:0; RULEID:; SRVR:AM0PR06MB4385;
x-forefront-prvs: 08200063E9
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(346002)(376002)(39860400002)(136003)(189003)(199004)(51444003)(53936002)(55016002)(33656002)(86362001)(6306002)(54896002)(9686003)(99286004)(6436002)(316002)(5640700003)(2900100001)(6506007)(5250100002)(7736002)(2501003)(7696005)(6916009)(256004)(74316002)(71190400001)(5660300001)(5630700001)(71200400001)(68736007)(3846002)(66066001)(8936002)(8676002)(6116002)(790700001)(486006)(1730700003)(97736004)(81156014)(25786009)(81166006)(14454004)(105586002)(106356001)(2351001)(2906002)(478600001)(476003)(72206003)(26005)(186003)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR06MB4385; H:AM0PR06MB4083.eurprd06.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: Amdocs.com does not designate permitted sender hosts)
x-microsoft-antispam-message-info: i8GTSZBs/4ZxWF085GHTlCV1RIXiUlK3oO00MDYFD65pZJYpjljbEUCsLZEXRgytbtog7igHOKgEFQKEaeR/5TNcEdK2XTT1avBdMLmhwtD6SfGgjkgjYOh8WYq93UNBWvtcOfKExHDE18bXsrlEphDFz0Q8zo8gZs9sNGkJ9eZfsaBzq+pTZFI7uZgO0ekjGwIadK5V/vFJby3SETa1L9QD9WhOLvGKg0tFAMz892a34qYF7HPtqvwn1SqDApKIzNRg3mcXubnEmjKubIjDSwUAlhz44w+tA5fTdTW3eR5njAMdYQt3qrXcrfg2PFnUe2+lfvssnzTaihZr55a/ifpQv97d5CquuwFvdWXSchQ=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_AM0PR06MB4083426FA0F1D3F6515F2ECFE7E70AM0PR06MB4083eurp_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 30b7794b-0540-42d6-af64-08d62e0fd259
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2018 17:51:20.6577 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: c8eca3ca-1276-46d5-9d9d-a0f2a028920f
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR06MB4385
X-OriginatorOrg: amdocs.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/w5BFhEv9Ud6CiBPyIK_6Q4JAqJ4>
Subject: [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, 09 Oct 2018 17:51:29 -0000

I have a question about “when” and mandatory objects.

It seems to me that the implemented semantics of “when” are really “optional when”, in that the enclosing object can be absent even though it is mandatory and the “when” clause holds true.
The RFC could be clearer about this.

Example

   leaf color {
     enumeration  {
        enum “blue”;
        enum “black”;
     }
     mandatory true;
   }
   container foo {
      when ../color = ‘blue’;
      etc.
   }

“foo” is optional due to the presence of the “when” statement even though the object is mandatory (same is true for mandatory leaf, min-elements=1 list etc.).
This is considered valid XML for the above
    <color>blue</color>

In my view this makes conditionally variant schemas “loose” in their enforcement (some scenarios can use choice but it doesn’t cover everything).

I think that mandatory should be respected for the enclosing objects of a “when” statement.
That is, a mandatory object must be present when its “when” clause holds true and a Schematron statement should enforce that.

What is the rationale behind the current YANG rules behavior, that the “when” Schematron mapping doesn’t check for presence of the enclosing mandatory object?

thanks
Mike Rehder

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