[netmod] choice statements and trim vs explicit default handling

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> Fri, 07 April 2017 22:50 UTC

Return-Path: <jason.sterne@nokia.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 553A6128DE7 for <netmod@ietfa.amsl.com>; Fri, 7 Apr 2017 15:50:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.697
X-Spam-Level:
X-Spam-Status: No, score=-4.697 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, RCVD_IN_MSPIKE_H2=-2.796, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nokia.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 CTcRsSPZsSzt for <netmod@ietfa.amsl.com>; Fri, 7 Apr 2017 15:50:35 -0700 (PDT)
Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30098.outbound.protection.outlook.com [40.107.3.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 483F9128B8E for <netmod@ietf.org>; Fri, 7 Apr 2017 15:50:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VmSJmk+qQ2NsAHHBMXMOp71nGwoCpX/tz0j2IF2vLQ8=; b=jRZM/NiV4FKF7zZUQ2OA0QhcBudVo5nGZl+ufPBGFnezlIL4/Dxv/uTtVvUEqxEYg39MQn3kVvgkmenX9ysGBMkwrjdm5i8mSy8YUg94JwSziMi0Rye2FUqz+5aBZxXFvofzmC8RIBrsSXlO40HonLBC2zrwFYiK/yVYkRzn+wI=
Received: from HE1PR07MB0843.eurprd07.prod.outlook.com (10.162.24.16) by HE1PR07MB0844.eurprd07.prod.outlook.com (10.162.24.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1019.8; Fri, 7 Apr 2017 22:50:28 +0000
Received: from HE1PR07MB0843.eurprd07.prod.outlook.com ([10.162.24.16]) by HE1PR07MB0843.eurprd07.prod.outlook.com ([10.162.24.16]) with mapi id 15.01.1034.007; Fri, 7 Apr 2017 22:50:28 +0000
From: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: choice statements and trim vs explicit default handling
Thread-Index: AdKv6w7/8xX3pfT5TQy0uN4Yo4P2Tw==
Date: Fri, 07 Apr 2017 22:50:28 +0000
Message-ID: <HE1PR07MB08433E9459870BCF06F754349B0C0@HE1PR07MB0843.eurprd07.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: ietf.org; dkim=none (message not signed) header.d=none;ietf.org; dmarc=none action=none header.from=nokia.com;
x-originating-ip: [135.245.20.8]
x-microsoft-exchange-diagnostics: 1; HE1PR07MB0844; 7:TVUxU5eaxQvyUq2OQuFyYTaXvV4QI8fs8/ItEkwQuD28hQ0IBsvd/xhDHEgFfHOt/qaE6wUQ9psFIrznkKZQhxHzCG7wIkkKFJFotNsmXvkH+Rw2OeFSAuTNFbS91ddaEFB9K/SdQdYkWD8AWgnDH8RNXkAOePGJy2s9OeFNQp8uE0F6sVIv7nn8WLRiUokqq8klrzacIzJt0yO2WLrCkzs9I50Wwzocu9KAALBljGcOWJUiwjWDZGQ4Syh0HOSIRjkA0RR7ANZkyQj4Vbwfqb7gDT2o+a3U1cw+SGHZItTHO3oA1cGO+0JTVtN8PoUzcoPMH/S5PfC0d/Rg4DhzKQ==
x-ms-office365-filtering-correlation-id: 7d0a4f33-2dc6-4dd7-6bc6-08d47e087cd6
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081); SRVR:HE1PR07MB0844;
x-microsoft-antispam-prvs: <HE1PR07MB0844DEC675F986145B3183A99B0C0@HE1PR07MB0844.eurprd07.prod.outlook.com>
x-exchange-antispam-report-test: UriScan:(158342451672863)(21748063052155);
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:HE1PR07MB0844; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB0844;
x-forefront-prvs: 0270ED2845
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39410400002)(39400400002)(39840400002)(39450400003)(39850400002)(39860400002)(53754006)(86362001)(2501003)(6306002)(38730400002)(6506006)(189998001)(53936002)(66066001)(25786009)(7696004)(19609705001)(6916009)(2906002)(55016002)(3280700002)(110136004)(3660700001)(54896002)(2351001)(77096006)(33656002)(74316002)(7736002)(5630700001)(6436002)(122556002)(8676002)(5640700003)(9686003)(3846002)(50986999)(102836003)(81156014)(99286003)(8936002)(1730700003)(54356999)(2900100001)(790700001)(6116002)(81166006)(5660300001); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB0844; H:HE1PR07MB0843.eurprd07.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: multipart/alternative; boundary="_000_HE1PR07MB08433E9459870BCF06F754349B0C0HE1PR07MB0843eurp_"
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2017 22:50:28.3941 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB0844
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/saxo3cGXZ4jMJxKIVez2jAFmSgw>
Subject: [netmod] choice statements and trim vs explicit default handling
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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, 07 Apr 2017 22:50:40 -0000

Hi all,

When a server operates in 'trim' mode (rfc6243), setting a leaf to its default value removes it from the config (i.e. it is indistinguishable from the case where that leaf was never configured or the case where that leaf was deleted/removed).

(A)
Does setting a leaf in one case of a choice to its default value (in a 'trim' mode server) cause leafs in other cases to be implicitly deleted ?  I assume not.

For example:

choice foo {
  case aa {
    leaf some-bool { type Boolean; default "false"; }
  {
  case bb {
    leaf some-num { type int32; }
  }
}

If some-num is currently set to 50, and then an edit-config sets some-bool to "false", does that clear the some-num leaf ?
(i.e. does it select case aa ?)

RFC 7950 says: "the creation of a node from one case implicitly deletes all nodes from all other cases".
RFC 6243 section 2.2.3 describes that a leaf set to default (in a trim server) doesn't exist.

(B)
Now how about if the server operates in 'explicit' mode ?  Does setting some-bool to "false" clear some-num ?  I assume it does (but it just seems a little funny that the behavior on this changes between trim and explicit servers).


Regards,
Jason