Re: [netmod] ?==?utf-8?q? Augment with a when and an action

tom petch <ietfc@btconnect.com> Fri, 25 September 2020 10:57 UTC

Return-Path: <ietfc@btconnect.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 7DBA33A135A for <netmod@ietfa.amsl.com>; Fri, 25 Sep 2020 03:57:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAD_ENC_HEADER=0.001, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=btconnect.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 LUxj1_X9fnFU for <netmod@ietfa.amsl.com>; Fri, 25 Sep 2020 03:57:10 -0700 (PDT)
Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2104.outbound.protection.outlook.com [40.107.22.104]) (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 5BF933A1350 for <netmod@ietf.org>; Fri, 25 Sep 2020 03:57:10 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lW3Ro+277x2BQLN6f/1eTitgFsGrSQCOj+Sp3tnuUdpQ4EL101X3dQR7jJdv6MTCRJOwBfFd1/o52aeO95P50RvcF6uA5vwBsDfGZWBhU6z8S0Cro5NHCxsHKRw4DbP3NPa4oRUFtszxENKqlXzrjXeN424KVW9FMVp0UE6zMJ1iiewvffZlWCvOyZOQ1v/RawlO0H8vsJSFPU/w32kDc3eubnKRoyRRycQZvg4dhhIoASm4ovJQhggX+uYQP8A+hPI5N19HQKl1pG2B2VDDGYZ0gmJ/uE/huYL8Gjixkfl7YkBFvoEQ78WhdYHjNmIxae+Xsa6tueQTMiRA3jDlRw==
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=77tSp08I/+aNTiBf/GPAJSeSbHaKwsqqJtO36Dp4XXs=; b=KUCgP+NEnB62mERW5nkW/Wg1/UtpSfA9IkaXZsCrbh5wWTCgsuf6g45zQdqXi7APYYgGQ/1+dkZr9wiY1wJV871YB/F02RfGQc1A9z1UB8kiUwZ1rLrdTD2BuO6rP7tAS1PXOXOhuSzSzAI82J/zQAaoBjVcX6Kf73wAda2x9fZTPl9x5rHGeM87f6V7srxFEnQk87DCLLOwnZMtOMtWYRA1ARGKIthXMZtMJEilpMG1hqlOl8tAwgaikRQK+6kUu44MMg2xN7MOp6H7MyaIRlqAfCIUiHLJ3tlPnvoMq/sIrJOXIlN3WPxcJt6+TKtK0U4EneuhcxBg5T2Z1S4luQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=btconnect.com; dmarc=pass action=none header.from=btconnect.com; dkim=pass header.d=btconnect.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btconnect.onmicrosoft.com; s=selector2-btconnect-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=77tSp08I/+aNTiBf/GPAJSeSbHaKwsqqJtO36Dp4XXs=; b=KXWLK4H3pTtz58abi4xZRdmqF2WXOvtH0MqruD5aOYxty74h/ruU4iPk/BqphquB2d0vIE4PeE+3D02PaVayJUsx0hBJAQPs2xk4GMnOjiD5KGB98Z52wQAAJv/fkLrn3/DPD9tv2XiHrBSSjfZJ5xrPIjFrWefZjHDglHQ5/eI=
Received: from AM7PR07MB6248.eurprd07.prod.outlook.com (2603:10a6:20b:134::11) by AM6PR07MB5813.eurprd07.prod.outlook.com (2603:10a6:20b:97::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.18; Fri, 25 Sep 2020 10:57:07 +0000
Received: from AM7PR07MB6248.eurprd07.prod.outlook.com ([fe80::189c:ac35:ce23:d38a]) by AM7PR07MB6248.eurprd07.prod.outlook.com ([fe80::189c:ac35:ce23:d38a%6]) with mapi id 15.20.3391.006; Fri, 25 Sep 2020 10:57:07 +0000
From: tom petch <ietfc@btconnect.com>
To: Michal Vaško <mvasko@cesnet.cz>
CC: netmod <netmod@ietf.org>
Thread-Topic: [netmod] ?==?utf-8?q? Augment with a when and an action
Thread-Index: AQHWkyVITIqNsIelmUu9wZynHueDlal5LUQo
Date: Fri, 25 Sep 2020 10:57:07 +0000
Message-ID: <AM7PR07MB6248A3A930A4F3C34823C423A0360@AM7PR07MB6248.eurprd07.prod.outlook.com>
References: <792b-5f6b0300-81-2dbef1c0@191831142>, <2172-5f6dc400-9b-4d43cc80@70248983>
In-Reply-To: <2172-5f6dc400-9b-4d43cc80@70248983>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: cesnet.cz; dkim=none (message not signed) header.d=none;cesnet.cz; dmarc=none action=none header.from=btconnect.com;
x-originating-ip: [86.146.121.140]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: a9f42a58-44a0-46da-cd5d-08d86141bef4
x-ms-traffictypediagnostic: AM6PR07MB5813:
x-microsoft-antispam-prvs: <AM6PR07MB58138A490F271404FB442E69A0360@AM6PR07MB5813.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: BR267UiECUoaIiNvB+kT3AYAOtiMOMqwHUItBPoB4izHyJSiHYrwB+c6iPVwUtHEhM+9tWZNKgukY5TXBbLB7mfNu7dcWUHNsaFIwdZN36tti5h8vaSM85sU1tU9meR1zahyKtooRyQY8Wc4p8dIN/jc7txr7+TRlzFMZvRhvp5rGujtAQiZhCOnJlXY2IdUv95x126w/4pbFlNq0e1uYXfzx3apf8I5ELSG82uXsAEu+ixN3glc/GqpxycO4rdtFSVkH5vss4guBFSqVyrJFfkwgFt/+S67fqGktBq2LkG0LCzEJt0aD43Ferw6ULx8nYyQFm7KOINfwsc7exo7/wg3ckZ34vwAu310ekInecxIJ2Z6uwygsko6T21F2J+3EQv0F6y/GrKk44SNspH7dA==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR07MB6248.eurprd07.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(376002)(346002)(136003)(39860400002)(396003)(8936002)(8676002)(478600001)(966005)(316002)(66946007)(76116006)(186003)(7696005)(26005)(6506007)(53546011)(86362001)(33656002)(4326008)(2906002)(9686003)(6916009)(91956017)(83080400001)(55016002)(83380400001)(52536014)(66446008)(66556008)(66476007)(64756008)(66574015)(71200400001)(5660300002); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: VYOjJzHPrP+vysn7BOTH104U2ehP+yjJ8eCiBasBT0IZXUCIOfLIC/XXVZH3pFYAR8noY12EIgvWIIghUHXhaX4t6vZifpRAMOunI1aL+tsvClhFfMpsIQyQ3aXqIX1CqZ0IbC0rwcV/y1nuIBh/2EGiZ1/5rt8XP/2z0dHgyvEKX2Nf/3hLRW2fCwJWGY+T5r+EmKZ6FPDhfmbuIogAKRRitUvPvgu/S5uAnoHuoMmptjH8NOwxxCB4xTjVpI0ERdYXtDarMICD5EoMORkHrR6GN8cGJJ7z8v7KRvlh8tzECKEgZyMaIIEKnCbd2/+Wia58UP+0u/YVvVZmuFsEdXzI2ZAYs4uRCYbsEIbMxAt3gHJ5EIzWx2m2dlK1/Yq0ybWv2DqsUUnjE8WExtEkjj9kg3kSD+vMp85Py/zjsuWkHcc23boLTwIzLahSn82S4bwlKqr55pWVi3LTBL22ryAgEAxuaGKFAXiU1VkjlCu74SHaWgKoGAP+Lc8n2qKudK2J8m5bbzJ3woXeMVXAkBj4AdPurq4pPjkTrZgfDZb71amu3BTh39NRUYqyRJmRbAEZXefb9j8ascUJlgms63u1RRhBCSD1mYf76FLrMfTZl9Z3agey8c/jAqWQeOEtB6sHAJhwXfSF9bBkXfjNhQ==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: btconnect.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AM7PR07MB6248.eurprd07.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a9f42a58-44a0-46da-cd5d-08d86141bef4
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2020 10:57:07.6492 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: cf8853ed-96e5-465b-9185-806bfe185e30
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 1oy8/lWTPX/H7nmDVZBQEQ+PAFR26GsspaBXd0y/O0SkLNFqIpPCCF/saRYvfD+lEwVcrD/vmYbe9vC2DVOa0g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR07MB5813
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/c0jN0RRl-raMfIAksaeQnoREYg8>
Subject: Re: [netmod] ?==?utf-8?q? Augment with a when and an action
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, 25 Sep 2020 10:57:13 -0000

From: netmod <netmod-bounces@ietf.org> on behalf of Michal Vaško <mvasko@cesnet.cz>
Sent: 25 September 2020 11:18

Hi,
since no one replied am I to understand this is an unforeseen use-case? In that case there could at least be an agreement on what the behavior should be because I want to know what to implement in our tools.

<tp>
As it stands I think that the YANG is invalid but taking the general question, I see no problem.
'when' makes its parent conditional, what comes after is irrelevant, so if the 'when' is true, the augment happens, if the 'when' is false, the augment does not happen.

There are constraints on the placement of an action and these determine its validity.  Whether it got there with the help of a augment or not I do not think makes any difference.

Tom Petch




Maybe at least warn about an unsupported use-case and ignore the "when" with respect to the action (there still could be other nodes in the augment for which the condition can be valid)? Or be more strict and forbid this use-case with an error? Or this is really just a corner case when there is only a node(s) in the augment with "when", for which the condition is not taken into consideration and it should be ignored with no additional messages?

Also, there is a similar use-case with a notification instead of an action and the behavior should be the same.

Regards,
Michal

On Wednesday, September 23, 2020 10:11 CEST, Michal Vaško <mvasko@cesnet.cz> wrote:

> Hi,
> I would like to ask for some clarification on what exactly the following (valid, I think) YANG snippet means:
>
> container cont {
>   container cont2 {
>     leaf l2 {
>       type string;
>     }
>   }
>   leaf l1 {
>     type uint32;
>   }
> }
>
> augment /cont/cont2 {
>   when "/cont/l1 == '5'";
>   action act;
> }
>
> What exactly is the effect of the when statement? Is there any, since action cannot have a when directly? Or it actually makes the action conditional and if the when evaluates to false, the action should be treated as not defined?
>
> Regards,
> Michal
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod



_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod