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

"Reshad Rahman (rrahman)" <rrahman@cisco.com> Fri, 17 May 2019 19:59 UTC

Return-Path: <rrahman@cisco.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 B2A7E120164 for <netmod@ietfa.amsl.com>; Fri, 17 May 2019 12:59:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.5
X-Spam-Level:
X-Spam-Status: No, score=-14.5 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com header.b=AsJ9Ny6e; dkim=pass (1024-bit key) header.d=cisco.onmicrosoft.com header.b=BRZxx2lx
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 Z3bNWaNbIZXb for <netmod@ietfa.amsl.com>; Fri, 17 May 2019 12:59:45 -0700 (PDT)
Received: from alln-iport-4.cisco.com (alln-iport-4.cisco.com [173.37.142.91]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 807A71200A4 for <netmod@ietf.org>; Fri, 17 May 2019 12:59:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=7337; q=dns/txt; s=iport; t=1558123185; x=1559332785; h=from:to:subject:date:message-id:references:in-reply-to: mime-version; bh=HxfXGKf/VhfU05zmNG6ln0eTCe3ItZBcYULHulNuSJ8=; b=AsJ9Ny6evLbdS4E1mQZm9rHKK7iHbSPw8dPOAXpcpWIw1eHH3fL3Xdb/ 1/AcTQsHCQrOV1Xuh/nAxEJOVQH987KBS9bZV5V+42/BDBUUzTJ4o3WUQ 8r3kDVm47RUYHm4VzQh5N/Bb60yUMtO6BnfuclZoFDdx/Szt/0I6Wo1Jn U=;
IronPort-PHdr: 9a23:uF70hBeFap5E70F/vS1fdbKAlGMj4e+mNxMJ6pchl7NFe7ii+JKnJkHE+PFxlwGRD57D5adCjOzb++D7VGoM7IzJkUhKcYcEFnpnwd4TgxRmBceEDUPhK/u/dTYzHMFLUndu/mqwNg5eH8OtL1A=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0ByAADcEd9c/5RdJa1kHAEBAQQBAQcEAQGBUgYBAQsBgQ4vUANpVSAECyiEEoNHA453SoFoJZJZhE6BLoEkA1QJAQEBDAEBIwoCAQGEQAIXgh0jNQgOAQMBAQQBAQIBBG0cDIVKAQEBBBIRChMBATgPAgEIEQMBAisCAgIwHQgCBAESIoMAAYEdTQMdAQ6fcAKBNYhfcYEvgnkBAQWCSII8GIIPAwaBNAGLUBeBQD+BOAwTgkw+gmEBAQIBgX4Ngl0ygiaNdYRdiBqNLgkCgguGLoxNG5YYjFGGaY5OAgQCBAUCDgEBBYFQATaBV3AVZQGCQYIPg2+FFIU/cgGBKI88AQE
X-IronPort-AV: E=Sophos;i="5.60,481,1549929600"; d="scan'208,217";a="272900746"
Received: from rcdn-core-12.cisco.com ([173.37.93.148]) by alln-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 17 May 2019 19:59:44 +0000
Received: from XCH-ALN-016.cisco.com (xch-aln-016.cisco.com [173.36.7.26]) by rcdn-core-12.cisco.com (8.15.2/8.15.2) with ESMTPS id x4HJxhm2006205 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Fri, 17 May 2019 19:59:44 GMT
Received: from xhs-aln-002.cisco.com (173.37.135.119) by XCH-ALN-016.cisco.com (173.36.7.26) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 17 May 2019 14:59:43 -0500
Received: from xhs-rtp-001.cisco.com (64.101.210.228) by xhs-aln-002.cisco.com (173.37.135.119) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 17 May 2019 14:59:42 -0500
Received: from NAM05-CO1-obe.outbound.protection.outlook.com (64.101.32.56) by xhs-rtp-001.cisco.com (64.101.210.228) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 17 May 2019 15:59:42 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cisco.onmicrosoft.com; s=selector2-cisco-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HxfXGKf/VhfU05zmNG6ln0eTCe3ItZBcYULHulNuSJ8=; b=BRZxx2lxbidPiFvmD8PG5WImk7RQpSQveuhREd8bUR669s372VozcB249o0i2Va4LyFBrj4cmPsrpjOoqdFqJlQpDaBqkc2O1hgN7PAabq4byecqDYJqkYYeh/9PuHSyfc+fnp063TDbyPMAKjjvxr4q0Ci4o3apK9nmjBxT4lw=
Received: from DM5PR1101MB2105.namprd11.prod.outlook.com (10.174.104.151) by DM5PR1101MB2250.namprd11.prod.outlook.com (10.174.246.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.17; Fri, 17 May 2019 19:59:41 +0000
Received: from DM5PR1101MB2105.namprd11.prod.outlook.com ([fe80::6ce2:350d:6bed:7dde]) by DM5PR1101MB2105.namprd11.prod.outlook.com ([fe80::6ce2:350d:6bed:7dde%2]) with mapi id 15.20.1900.010; Fri, 17 May 2019 19:59:41 +0000
From: "Reshad Rahman (rrahman)" <rrahman@cisco.com>
To: Kent Watsen <kent+ietf@watsen.net>, "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: [netmod] can a leaf of type "empty" have a "default" value?
Thread-Index: AQHVDOoo+hLRcZGMo0G6G25K8dQfVKZveT0A
Date: Fri, 17 May 2019 19:59:41 +0000
Message-ID: <4D3B1530-A671-4A3E-8461-77BE91507D7B@cisco.com>
References: <0100016ac75aaed8-31a9e97f-4419-49ad-ab8c-700a83d5f19e-000000@email.amazonses.com>
In-Reply-To: <0100016ac75aaed8-31a9e97f-4419-49ad-ab8c-700a83d5f19e-000000@email.amazonses.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/10.10.6.190114
authentication-results: spf=none (sender IP is ) smtp.mailfrom=rrahman@cisco.com;
x-originating-ip: [2001:420:2840:1250:2421:2f0a:1dbc:638e]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 94384ab3-153a-4160-3aed-08d6db023300
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:DM5PR1101MB2250;
x-ms-traffictypediagnostic: DM5PR1101MB2250:
x-ms-exchange-purlcount: 3
x-microsoft-antispam-prvs: <DM5PR1101MB22508651DDDA416B52BD1993AB0B0@DM5PR1101MB2250.namprd11.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:8273;
x-forefront-prvs: 0040126723
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(366004)(376002)(396003)(346002)(189003)(199004)(2906002)(58126008)(5660300002)(53936002)(110136005)(8676002)(71200400001)(6486002)(6436002)(7736002)(6306002)(54896002)(2501003)(316002)(81166006)(4744005)(8936002)(68736007)(71190400001)(83716004)(229853002)(81156014)(6512007)(236005)(256004)(86362001)(9326002)(66556008)(6116002)(66946007)(33656002)(76116006)(66446008)(73956011)(11346002)(2616005)(486006)(476003)(64756008)(6246003)(6506007)(66476007)(99286004)(53546011)(790700001)(25786009)(46003)(186003)(478600001)(446003)(91956017)(606006)(966005)(14454004)(76176011)(36756003)(82746002)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1101MB2250; H:DM5PR1101MB2105.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: cisco.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: aosCN+9TQbtEWbK2F/riQNME929S8gNNWhvjOf78U1FFBJXgDEQ/oy5NQI2774pTSIMRVWOQt43jcxkrUdYay9Z40qqrOX1SARKR5L4SUNs06Pn5Oq8WZcIQSg6CdzBszH/KnV5aHhoNHb3Of8EQEPH9x/Gz5/Neb36jJ64A5pHYY+EDnl/5/YaglsqfiUWDg9gIEruGQj0m84zcykeiKSOFJc1wqbHEsix2mvRdwVlDi/iM+jMBzEr8mx76i3ifSQe8V27CViELiHSKP8TzPsojHC6lKIIMBAAZJg3nDPI/W3XhG27JEHD5Kyj/F6uF6e1oEM+v8388fP+S2quqGw/TBO+H+CFTVZfaTAZzRJ3nSzOYatEAtuvXpyVwYjmyRDCV7H012wGoekyGQ9x16PjKAopOkIk6E8h8Oj3Ly3w=
Content-Type: multipart/alternative; boundary="_000_4D3B1530A6714A3E846177BE91507D7Bciscocom_"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 94384ab3-153a-4160-3aed-08d6db023300
X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2019 19:59:41.0503 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5ae1af62-9505-4097-a69a-c1553ef7840e
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1101MB2250
X-OriginatorOrg: cisco.com
X-Outbound-SMTP-Client: 173.36.7.26, xch-aln-016.cisco.com
X-Outbound-Node: rcdn-core-12.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/wd3jX1tJy2JX185PBASmuLZcIfQ>
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 19:59:48 -0000

Hi Kent,

From 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