Re: [Netconf] [yang-doctors] YANG Doctor question: empty mandatory choice?

Kent Watsen <kwatsen@juniper.net> Thu, 09 August 2018 14:38 UTC

Return-Path: <kwatsen@juniper.net>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5CB7F130EE6 for <netconf@ietfa.amsl.com>; Thu, 9 Aug 2018 07:38:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.711
X-Spam-Level:
X-Spam-Status: No, score=-2.711 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=juniper.net
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 rnX6zQB3PBjl for <netconf@ietfa.amsl.com>; Thu, 9 Aug 2018 07:38:39 -0700 (PDT)
Received: from mx0a-00273201.pphosted.com (mx0a-00273201.pphosted.com [208.84.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9BD82130F74 for <netconf@ietf.org>; Thu, 9 Aug 2018 07:38:39 -0700 (PDT)
Received: from pps.filterd (m0108158.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w79ETU6i001928; Thu, 9 Aug 2018 07:38:35 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=PPS1017; bh=caxzydooET5V4sQubrqMKXdez8HTKkPGMlgSi/ISJBQ=; b=VbzmoILt8GVuCar4HsYNsUjzGMl3Yb1suCtmhpILtujPEtpG4KiTFgRLPlJN0lyV0D1U o2YloakW+BlSQ10OBhLRXtIuQt/XctmHHZb/oaUVVUYOktvHyLJHb8RxFg1plPM/VbAV mkLo9SYocrj341RYrqvFVrpwWAE5hsE8pNjCSaEvBkQrPSYM484D66YcaLLE6yxhOhLo UCC+RlekDS0uKbq4KoNOpUcm5Xq3hFUdKl3rdB+wDV8Ys33AfcNJqDYibIFJ8rOSBje5 esA7T/Gj94cw0nB/zCZEXYRdf7qI9+UzJJr+OtdyyWU+CaCtzSBj3oEsNagkMulFOMJ9 ig==
Received: from nam01-bn3-obe.outbound.protection.outlook.com (mail-bn3nam01lp0178.outbound.protection.outlook.com [216.32.180.178]) by mx0a-00273201.pphosted.com with ESMTP id 2krgp60w8w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 09 Aug 2018 07:38:35 -0700
Received: from DM6PR05MB4665.namprd05.prod.outlook.com (20.176.109.202) by DM6PR05MB3993.namprd05.prod.outlook.com (20.176.71.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.9; Thu, 9 Aug 2018 14:38:33 +0000
Received: from DM6PR05MB4665.namprd05.prod.outlook.com ([fe80::e0bc:6a82:571d:258]) by DM6PR05MB4665.namprd05.prod.outlook.com ([fe80::e0bc:6a82:571d:258%2]) with mapi id 15.20.1059.010; Thu, 9 Aug 2018 14:38:33 +0000
From: Kent Watsen <kwatsen@juniper.net>
To: tom petch <ietfc@btconnect.com>, "rwilton=40cisco.com@dmarc.ietf.org" <rwilton=40cisco.com@dmarc.ietf.org>, Martin Bjorklund <mbj@tail-f.com>
CC: "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: [Netconf] [yang-doctors] YANG Doctor question: empty mandatory choice?
Thread-Index: AQHUKbd2gxK9WoMf0kWoD5voFWQc9qS3Rs0A
Date: Thu, 9 Aug 2018 14:38:33 +0000
Message-ID: <E4A0250D-B2B9-47D5-81EF-275A0144379A@juniper.net>
References: <05ee68cd-ccc0-6803-6c71-b3952ee5608d@cisco.com> <CABCOCHRtg9jB0=b5bPPT3MS0QJcwgAY24Fg0RewXhPMR8Y+O0w@mail.gmail.com> <958669b9-c523-3c43-eca4-fbc255fc1bc8@cisco.com> <20180805.111123.2123994471181114333.mbj@tail-f.com> <03f501d42e2a$da6f0500$4001a8c0@gateway.2wire.net>
In-Reply-To: <03f501d42e2a$da6f0500$4001a8c0@gateway.2wire.net>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/f.20.0.170309
x-originating-ip: [66.129.241.12]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; DM6PR05MB3993; 6:pAyoj7lRP4SOLHnrp0nP60oZtM1Tsw9WvKf3OKUsNrykvByKyvnQz+uRXv8AIfN4wgsfI+QMXu8u2Jv2kn7pJJEr1mL5eY4IkSwdqMjp94WHepFR1q1XCbuyrXxwUJyFoxiT2gCnizjoRSE2X90R1N68sIgOGgMAsvZxBRmP/iTpM8MEo9EoW+tImiGxkO3QRGFcUEl4EZojADAynbITbppMnkzoNegBVk/+bxadBXZOLsPCWCDqCiVpJYikSRdAtMhmPQU04JIILVB8hzZb/uxocfTcRy05/ceEWjrVyytC9rIJUmbA94a6Mq+lCsjIRHYeSV3RXo4kT3qlAcrY/o7CTMSCnconWmW/WJvmZiC7i7b9tHcx12DrfmJ3f5jqYFJFWFovZmi1eMJY0oEJFPS/ynAseq7Liqqr1xGOffsHdL4BuD0z3awkd+d4LRyir7DSoY9ercPHS0IsPicqow==; 5:mIMWT/NZObfWRUeU+XtmRPMvTP1SCjJzlFM7lZldvZTOUNkOmOO9k1JE7lDvam3Y2HP7eClMAMKxiwnU97HwA1cyWU/iMVVlqfJhOI+75/yC+a8ZFxwswAspuM4nCChl1+JL9TUgrYv2DBVdYagAD7xUgD5XKRG5s1Dmmgo7w80=; 7:ugu/3x5okHI73yUAakIW+uZv8RG5S/dC4xyCCh7NrkiYse6JcwCPbDJtfo+J/hiQwy9tLhb3TYGEbkf1Uq1wLnL/tPKNFG4bVaeEIGaSjDr08/SmBgwpjSsudZsSCzUa05gjnJWIg8DohKVfVycODCRjkeiEvw8gvDazsOyGHvtEMkIS5xJAofIb8cGVkbTJMsh/cdYzRDEhOuGuRiXODXoJG1CRP0NDVfScUYk+7zf8R1d0riw4bhJ57LRz1J7a
x-ms-exchange-antispam-srfa-diagnostics: SOS;
x-ms-office365-filtering-correlation-id: 098efe4d-528f-4af9-a590-08d5fe05c861
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DM6PR05MB3993;
x-ms-traffictypediagnostic: DM6PR05MB3993:
x-microsoft-antispam-prvs: <DM6PR05MB3993752B8A4BA5AAE845E868A5250@DM6PR05MB3993.namprd05.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:;
x-ms-exchange-senderadcheck: 1
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201703031522075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DM6PR05MB3993; BCL:0; PCL:0; RULEID:; SRVR:DM6PR05MB3993;
x-forefront-prvs: 0759F7A50A
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(376002)(346002)(396003)(39860400002)(366004)(136003)(189003)(199004)(102836004)(14454004)(2616005)(476003)(66066001)(36756003)(82746002)(186003)(97736004)(486006)(446003)(11346002)(83716003)(8676002)(6116002)(3846002)(8936002)(5660300001)(256004)(81166006)(81156014)(26005)(68736007)(86362001)(2906002)(296002)(316002)(53936002)(6486002)(229853002)(6436002)(33656002)(99286004)(110136005)(58126008)(6512007)(93886005)(106356001)(7736002)(105586002)(25786009)(4326008)(5250100002)(76176011)(2900100001)(6246003)(478600001)(305945005)(6506007); DIR:OUT; SFP:1102; SCL:1; SRVR:DM6PR05MB3993; H:DM6PR05MB4665.namprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: juniper.net does not designate permitted sender hosts)
x-microsoft-antispam-message-info: dZ5xl6Vf69RRM64pUy7EXjdPabmIbjVKdD2QAzhVGsrdkjBqitc94dCgppDeg8QIgyy2B29p150xj9Ilw17jY+7BW+RdpgKFsNji5CJRWO+ZSNRz1WCdWgjbCUTp3p3Ww4ci2iFlZi2sfd/s9FuqGhvMnY/UecZ17Je38gMQLYpBHfvNWnQWMChNATHhrc2fjTZyNQxDwwwB7OzJHsyk5Fcmm6Bf0o6UHRgTtlRb8oHKWByDZJUH2SePOfp7qEYt5PMwp1zMnRz1Mml6mrzobQU8O49OUZv7uYAtwj6fD//Ad5MBl5QV2dSinjfrtuvmb/8DLIkAX/DnASgYcjKzBYpqlVMQJMhzueWUXO++ua4=
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="utf-8"
Content-ID: <23B86ECE94213744A8D700BC19600A7E@namprd05.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: juniper.net
X-MS-Exchange-CrossTenant-Network-Message-Id: 098efe4d-528f-4af9-a590-08d5fe05c861
X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Aug 2018 14:38:33.1536 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: bea78b3c-4cdb-4130-854a-1d193232e5f4
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB3993
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-08-09_05:, , signatures=0
X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808090151
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/32-034MAQSPP3LYn2a2iLBknSNc>
Subject: Re: [Netconf] [yang-doctors] YANG Doctor question: empty mandatory choice?
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 09 Aug 2018 14:38:42 -0000


Martin writes:
> In this case, or if the choice is mandatory, the model would require
> the client to configure an address if the transport is 'example-udp',
> which is what we want.
> 
> But if the choice is marked as mandatory, *all* transports MUST define
> some transport-specific parameters, even if that is not needed
> (unclear if this will ever happen...)
> 
> Thus, I prefer Eric's original model w/o the choice.  The choice is
> supposed to be clever, but might end up being confusing, and I don't
> think it adds any value anyway.


Tom writes:
> which I think it the key point.  Look at the discussion that has been
> generated on this list, where there is more YANG expertise than almost
> anywhere else, and wonder how the average implementer will cope with a
> mandatory, empty choice.  Clever, yes, good idea, err no, not for an
> RFC.


Martin makes an interesting point about how to model augmented in can
assert which nodes are mandatory, which we assume will always happen,
but it's not really our problem if they don't.

Also, regarding the idea of using distinct-values(), I don't think
we can, because it's only in XPath 2.0.  Besides, the intermediate
containers didn't look nice.

I am okay with removing the choice statement.

[as chair: Any other comments?]


Kent // contributor