[netmod] evaluating 'when' statements with unconfigured leafs

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> Wed, 25 September 2019 15:37 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 93853120019 for <netmod@ietfa.amsl.com>; Wed, 25 Sep 2019 08:37:26 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 NvqKovORPPPE for <netmod@ietfa.amsl.com>; Wed, 25 Sep 2019 08:37:24 -0700 (PDT)
Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80131.outbound.protection.outlook.com [40.107.8.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2F5E7120013 for <netmod@ietf.org>; Wed, 25 Sep 2019 08:37:23 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nhCY6+1KjOGPgbGYuqtTmRahEOsRJBoACJmWD4DLcQEmg8+AlLzQNZpe9J4O9PpDegUr5jSl0zMbGYqyiYB304OYAIAVV1eVML7C6K+Qzg1dnzYyCbMN5qWHYs6P9rjcgR6bEdJu4QvxnbAVpNaZdst26l91ibzO/Eln53uHZ16bsUYacTk558a6Tov2Nw4DeHBGrBQx/o6UtyH7MzpC0DoTZIMjJ1clRALMpId09yXfVYWDHocmDoy40ww1xtj5C5RV4661iHjODdtcr4CcIMMoEpttCj4GqWhlwwdeuLANFRxOozRBiRFQ+kTaahk9ISFkonCBoYvyjcejtgbX6Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F/Xei8BxjjvESsrsqOXytM4JlplvfTUTifBp1xsOdjQ=; b=XUu+x1hUrqqmA1XwYjUO27Bf7jAfO7XHcJpVw065d8xwBBjKHv3Irg9yJ6shMAKLQCfCMfpiebEuDf+nethxDcZ8TwpwcqqiWhHSoiS+KOgaxkvL39E1LjHu/pilwvUOkEvlJzUlR/ofLmbnJ3LshJOkoxs3WbRO5bszbB1vEfF4MZPCC1ROCOkVHieWLpuARvO+ANkWFDMhuwgzDzFNInlRpGeIRlMaMaNPJ8X/viI9F78PbsacpHrp73ZunrX9ZMtmz0J85pJfqf36MUsTuhy/UsxPf9qdmjE8etxaUUzVnx9WIVg+Y3LFuB+151oo26+RGVCeAI7WgyB9UZr+Yw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F/Xei8BxjjvESsrsqOXytM4JlplvfTUTifBp1xsOdjQ=; b=x0QVPUmGZGoLOp+RoWlCYRaS9k26eCTp/zzWNOS0vZVQeX4Q57Og95OxXBmns2nxUftXQFs4eHpVryon4y3zwXZfjbPj4XM/gQGUA1v4edpbzZLAYgI6+KFts6cswMu1YPS6Yzr2+B0/ZOsPS1XkRFlxb145mvSy+jyNNoICMaE=
Received: from VI1PR07MB3981.eurprd07.prod.outlook.com (52.134.28.141) by VI1SPR01MB0337.eurprd07.prod.outlook.com (20.176.8.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.15; Wed, 25 Sep 2019 15:37:21 +0000
Received: from VI1PR07MB3981.eurprd07.prod.outlook.com ([fe80::e976:ea85:c30c:db44]) by VI1PR07MB3981.eurprd07.prod.outlook.com ([fe80::e976:ea85:c30c:db44%6]) with mapi id 15.20.2305.013; Wed, 25 Sep 2019 15:37:21 +0000
From: "Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com>
To: "netmod@ietf.org" <netmod@ietf.org>
Thread-Topic: evaluating 'when' statements with unconfigured leafs
Thread-Index: AdVztlaksY9LmjUPRkOXky2jxUtn2Q==
Date: Wed, 25 Sep 2019 15:37:21 +0000
Message-ID: <VI1PR07MB3981888B6E7B657DD0E97F219B870@VI1PR07MB3981.eurprd07.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=jason.sterne@nokia.com;
x-originating-ip: [135.245.20.8]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 4dabc5d6-aa0a-4b91-0715-08d741ce418e
x-ms-office365-filtering-ht: Tenant
x-ms-traffictypediagnostic: VI1SPR01MB0337:
x-microsoft-antispam-prvs: <VI1SPR01MB0337F09B1B9A3994C2C60E869B870@VI1SPR01MB0337.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:8882;
x-forefront-prvs: 01713B2841
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(4636009)(136003)(346002)(39860400002)(396003)(366004)(376002)(53754006)(189003)(199004)(1730700003)(102836004)(486006)(66446008)(81166006)(2351001)(5640700003)(52536014)(316002)(476003)(6116002)(66476007)(8936002)(64756008)(66946007)(66066001)(2501003)(99286004)(7736002)(33656002)(76116006)(6916009)(8676002)(5660300002)(6306002)(86362001)(54896002)(26005)(4744005)(14454004)(2906002)(790700001)(55016002)(66556008)(71190400001)(3846002)(81156014)(7696005)(6436002)(14444005)(186003)(9686003)(6506007)(25786009)(71200400001)(256004)(74316002)(478600001)(461764006); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1SPR01MB0337; H:VI1PR07MB3981.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: nokia.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: lldgSJDyM5PtyHeJh2DrKsJKcLfxNvf3ENDcLLjvWuzev7jvyznMVjqOB3n5Vmxv7+E7GjyPaeyLQX4AdnG9Ogr2vbRWTw3OfecmEs+IxuYC12aH2ZVQwse31ba5WXnMQLtw3AmUmy53x3sSwlHIFP5oXeV7N7/0rOBeibL/fJR0LIsqaG109xtbTAf6g1w0Bny2rUV1bcKeUR5PiE514QEyJbit8LX2BwGNznCxaQ4DW4Hmjjhi2JpOJ0eVph+S1WY2tIm+X9GnuEDpYD9rfb+I7T/AZdyd4uLm0d/W3UumihL9943nQQmT0mBlvF00akjmk2bewJAzhFaQb5jbg/6KZzmidCDidt5Og9l1KAX1GdCvNf8XGz0Ijf0lYlW1xA/CyocTMLlnnX7mnqmolGgigAcRMw0K/rYVnkxWXZM=
x-ms-exchange-transport-forked: True
Content-Type: multipart/alternative; boundary="_000_VI1PR07MB3981888B6E7B657DD0E97F219B870VI1PR07MB3981eurp_"
MIME-Version: 1.0
X-OriginatorOrg: nokia.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4dabc5d6-aa0a-4b91-0715-08d741ce418e
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2019 15:37:21.2451 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 5d471751-9675-428d-917b-70f44f9630b0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: Az4oxV/duxMTkAMLT4oenFtkhbFwZTosvFjhSj7lNyKDxA5U41mO7IU5ePfeVyhDq+i11wECvk0C1CXI5FBHmg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1SPR01MB0337
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/MYgbxFYgTRYKf6FzZJ1MrAsRsXs>
Subject: [netmod] evaluating 'when' statements with unconfigured leafs
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: Wed, 25 Sep 2019 15:37:27 -0000

Hi all,

I saw some recent questions about 'when' statements. I had another one related to evaluating 'when' statements that involve leafs that don't currently have a value at all.

leaf foo {
    type enumeration {
        enum val1;
        enum val2;
    }
}

leaf bar {
    when "../foo != 'val2'";
    type uint8;
}

Notice that foo does not have a default statement. So if no manager has set leaf foo, it doesn't exist in the config.

In that case, does the "when" statement evaluate to 'true'  (i.e. leaf bar is allowed to have a value) ?

i.e. assuming leaf foo is not set at all, is this accepted?
<bar>23</bar>

Or is there something special here because of the non-existence of leaf foo?

If the "when" evaluates to 'false', then does the following "when" evaluate differently than the one above?
    when "not(../foo = 'val2')";

Jason