Re: [netmod] can a leaf of type "empty" have a "default" value?

Kent Watsen <kent+ietf@watsen.net> Fri, 17 May 2019 21:44 UTC

Return-Path: <0100016ac7c11b7d-054d8d19-87cf-4379-8038-634c99bc492b-000000@amazonses.watsen.net>
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 BDAE81200B5 for <netmod@ietfa.amsl.com>; Fri, 17 May 2019 14:44:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 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] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazonses.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 CovyZMdBrkGK for <netmod@ietfa.amsl.com>; Fri, 17 May 2019 14:44:44 -0700 (PDT)
Received: from a8-33.smtp-out.amazonses.com (a8-33.smtp-out.amazonses.com [54.240.8.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1000E120073 for <netmod@ietf.org>; Fri, 17 May 2019 14:44:43 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1558129482; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:In-Reply-To:Cc:To:References:Feedback-ID; bh=561KYiJbB85K2t73ja3/7epSp6fR+MG2/2m8dAYYZYA=; b=A/0blakg3r+MkqJz8PA8IdtiyXkY0CiebVPVFH9pXhdkG7g79cKkNaqcNg0QumLg aAF0Ozpx8pIFc+4PhFmwgSuXSjaa1cVR7BJkOvqRSD67IubkB7BA0XH2FD+8iBmKEAQ HFi4v9sYGANnzGyuUp/uM9dBReqgieC1wKzg+Hvw=
From: Kent Watsen <kent+ietf@watsen.net>
Message-ID: <0100016ac7c11b7d-054d8d19-87cf-4379-8038-634c99bc492b-000000@email.amazonses.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_54DE03EE-0978-4B04-94A7-AF683B6853F6"
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
Date: Fri, 17 May 2019 21:44:42 +0000
In-Reply-To: <4D3B1530-A671-4A3E-8461-77BE91507D7B@cisco.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
To: "Reshad Rahman (rrahman)" <rrahman@cisco.com>
References: <0100016ac75aaed8-31a9e97f-4419-49ad-ab8c-700a83d5f19e-000000@email.amazonses.com> <4D3B1530-A671-4A3E-8461-77BE91507D7B@cisco.com>
X-Mailer: Apple Mail (2.3445.102.3)
X-SES-Outgoing: 2019.05.17-54.240.8.33
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/5sQQLgzMojLQTisdY58ce9naxuA>
Subject: Re: [netmod] can a leaf of type "empty" have a "default" value?
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, 17 May 2019 21:44:46 -0000

Oh bother, my eyes glossed right over that.  Thanks for spotting it!

K.



> On May 17, 2019, at 3:59 PM, Reshad Rahman (rrahman) <rrahman@cisco.com> wrote:
> 
> Hi Kent,
>  
> From https://tools.ietf.org/html/rfc7950#section-9.11 <https://tools.ietf.org/html/rfc7950#section-9.11>
> An empty type cannot have a default value.
>  
> Regards,
> Reshad.
>  
> From: netmod <netmod-bounces@ietf.org> on behalf of Kent Watsen <kent+ietf@watsen.net>
> Date: Friday, May 17, 2019 at 3:53 PM
> To: "netmod@ietf.org" <netmod@ietf.org>
> Subject: [netmod] can a leaf of type "empty" have a "default" value?
>  
>  
> A leaf with type "empty" is often times used to represent a boolean: present == set, not present == not set.  Is there a way in YANG to specify that the "empty" type leaf is "set" by default?  Perhaps like this:
>  
>     leaf flag {
>         type empty;
>         default "";
>     }
>  
> Kent // contributor
>