Re: [netmod] ?= Augment with a when and an actio

tom petch <ietfc@btconnect.com> Fri, 25 September 2020 11:49 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 DB5F83A1399 for <netmod@ietfa.amsl.com>; Fri, 25 Sep 2020 04:49:51 -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, 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 irvwUDKLOxvG for <netmod@ietfa.amsl.com>; Fri, 25 Sep 2020 04:49:50 -0700 (PDT)
Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2124.outbound.protection.outlook.com [40.107.20.124]) (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 D84DF3A1397 for <netmod@ietf.org>; Fri, 25 Sep 2020 04:49:49 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XQ2TsrkfHsLbHtS8dhJUxoPESyfqmR9QKb9yV/xGGb5XpwDF2v3X43Y0O/IkfsJR2NGaQIp+xBH8d73K7i6vjFBUq+sv3dLuyG6hiE9UOFlFUbIEMe6A4TxkeKg+N5I3gUSV0c56DhQZT5mX9CSWUI5Bc38lnc0ceVQlgYNrPFmtDDosrnBpNlSomBBnkB1YL41iM2W+XVpcxAG4tqM3HCq5Io0pJSqCiMoAEDxn/VxaxR5lIeNXWyvUY14EDfNpfUN3P4O21yJzLqFEpS32E7ZPVQx9mgsvBmF9J6kYBK+PwHwDQIzylWU9u+cquk/V6DPi4u7FHH4/vNZ+h221Qw==
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=i59/xyViiMmGK6CLHbp2Rj5EwwG+UIwi18eWK7YSdP4=; b=TtqMMEB45BJgmT5BrHaEbAreXHyNjjva4FO2yZ8S9npObFOG/NL7qRZiBhq5JPcIxctsi5jnT2uEQOw9EsBuJf4s2XqJwllkxMRuaLlWp/7sEaFzcHiFoAS1j3rV1ojhIIHrfsGcMe7X38Olowo4/RKnJLO0YKbCBSQRjDIFp9UPIDmDzzJD1OD5DHY+QK1y6PQt0pbVxvXHqenE45dtRuS0f+baPAJLIRQ91d0NKTTN6gwMUBzd24z3vi4kqMh8xvpZpleoXZALW3/ItTmoxo5cV/paoLZHTsFrMOq1X5lOOtRu/G2lbUrSRpDygxhr7Pg4m0DhtWdXA4BE0f2llA==
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=i59/xyViiMmGK6CLHbp2Rj5EwwG+UIwi18eWK7YSdP4=; b=Of4wfw9BKIzM0V/nci4qIBvpk+2c0MXDLmkshcf1IThaTKKApbhRzOZgIbbGUakAmGoo02quwtSyYp9YuzQJ+yJbOBNEVzV4wiNoS4owHjY98r+U6wv6kAmlX5xaNDNg0oAJf3vXNPJY8TVR0m0AOQ5NN2czuqwHy59MvwE02Gc=
Received: from AM7PR07MB6248.eurprd07.prod.outlook.com (2603:10a6:20b:134::11) by AM6PR0702MB3669.eurprd07.prod.outlook.com (2603:10a6:209:11::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.8; Fri, 25 Sep 2020 11:49:47 +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 11:49:47 +0000
From: tom petch <ietfc@btconnect.com>
To: Michal Vaško <mvasko@cesnet.cz>
CC: netmod <netmod@ietf.org>
Thread-Topic: [netmod] ?= Augment with a when and an actio
Thread-Index: AQHWky2cKW3XQdKJHEmgkSS5EOgUlal5OU+9
Date: Fri, 25 Sep 2020 11:49:47 +0000
Message-ID: <AM7PR07MB6248589FADECA47D5EFB4006A0360@AM7PR07MB6248.eurprd07.prod.outlook.com>
References: <AM7PR07MB6248A3A930A4F3C34823C423A0360@AM7PR07MB6248.eurprd07.prod.outlook.com>, <40a7-5f6dd200-ef-438e2300@60807902>
In-Reply-To: <40a7-5f6dd200-ef-438e2300@60807902>
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: efb470d7-0898-4820-ecdc-08d861491a39
x-ms-traffictypediagnostic: AM6PR0702MB3669:
x-microsoft-antispam-prvs: <AM6PR0702MB3669C396DC000BCAB18DAC9AA0360@AM6PR0702MB3669.eurprd07.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:7219;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: aik5A8wB332W0hlpXrl1sXQmk1QFOhmPaJrzP6vZQpD+lkQX+h84koH0jYIj71AWFS6WFeJqbj48WIzDjq4SIq8YkPoSWOdFm4PR6w+Up+0nrDYTzNe/yN3Cr2br3yokIpECJbrSrse7RHKleWqq523kSIRw90Ge/LPpX8DbyXMyTU9qN5t4yEpOtTw6gNwsjBehnMmvhZ/rhn4zg8VzIJshi16ojcuHC3UUdOD74ji9DCzPzDSTLmpzTNO9xn8j2cW7hnNduyCFgiGabBihqawphTf1mnAVhbEavjLPjw54GNMa+ox7lSEsqFB3DI08o2xQwTNEDRdlbYz0apHZKQyW6vulLFi3PnQLiJ7GQ5r0O2l4RUu35IyAe/yRcDQ8sbx/GIHry7EDc79/7ITi8g==
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:(376002)(136003)(346002)(396003)(366004)(39860400002)(66946007)(66574015)(91956017)(66476007)(53546011)(316002)(6916009)(186003)(76116006)(6506007)(4326008)(2906002)(86362001)(33656002)(66446008)(26005)(55016002)(5660300002)(7696005)(66556008)(64756008)(71200400001)(966005)(8676002)(52536014)(8936002)(83380400001)(9686003)(478600001); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata: rhaTDfOi/qHsB0B8Fjjl7qlRD/IGid1dTehd9saw5DOAIJDq4wO5GLW9ohos3DZKsaoeUhEMy7Pi3aqZQeFiqcCGVG6xC1bM6c5OXqaeLTJ9HPPsX7C3NeQm0eWKcLUkifFYaNhMwntkqRewjelmKGpt2PM6mLUzAAbcOk08mruH21hfw2BKtSwWgXOVNxoVTVTV/68nBdCp4RtRAlTvYivSrHmsIzv4z22lYv5fl6MAxPaWCNli7ht3Jw4j8wce7jZDiEFwaK6ndG3H+GuRADysFrznpLT6en+juhr2v1K21ruEmBz99L4MdiukkeOYv4/Raq4Rk6xLlRPfsfcUichJXAW/U0MMOXyaYFQtmsLRPLdbFtisPHzVaoWiyKDt1xgTV4YtimUs8ASHrdBIJvKae12NTGQiC4TKIgMMNG3LCX3tAIP07bKtGR0IS2PnDDXcPwtnDltzmuRfDoCisjrpP2gkju34/YfMTFgDro6Z91MLUf3qrIa+ltDggTHweYKYhd6EJaQVvfdibXHyx5AH7smBFouQATGpaONCYMLicPrCWSXrzpwrPysGer2szRWC9HtXFeX5L9Ayz+xKIZ4jbzgjYE7O5hKDoIVEYU7E7Ukal2+aYvQhT7EDcOoq5wIUulflra1xGPyvgqFt2A==
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: efb470d7-0898-4820-ecdc-08d861491a39
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2020 11:49:47.2838 (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: Ggc84ct5VENThV7al4uF1iyvaBiKykUH3gKwAGejvt3PJZ/LkQYVuUkNMuYAdXH0fEKtieL9P625Rx1+0FCyFw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0702MB3669
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/V-wByPxMFR83f1WCYSEVchMNxTs>
Subject: Re: [netmod] ?= Augment with a when and an actio
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 11:49:52 -0000

From: Michal Vaško <mvasko@cesnet.cz>
Sent: 25 September 2020 12:18

On Friday, September 25, 2020 12:57 CEST, tom petch <ietfc@btconnect.com> wrote:

> 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.

I beg to differ on this point. The difference is that "action" cannot have "when" as a substatement. However, in my use-case (is defined in "augment" with "when"), the behavior would be similar to "action" having a "when" condition directly (you have to evaluate it to decide whether the "action" can be executed or not). Now, I believe there is some reason why "when" is forbidden for an "action" although I do not know what it is.

<tp>
Well, I differ:-)  
augment when
action
I see as quite different to
augment
action when
that is that the 'when' only affects the preceding statement as RFC7950 s.7.21.5 says.  What comes after is of no concern to the 'when'  Note too the comments about 'augment when' in s.7.21.5..
More generally, 'when' is troublesome and the e-mail archives are full of issues thereto with one comment asking why 'when' is 10X harder to implement than anything else in YANG:-)

Tom Petch

Regards,
Michal

>
> 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