Re: [netmod] [Anima] mcr's YANG question raised during the ANIMA WG session

Jan Lindblad <janl@tail-f.com> Fri, 05 August 2022 08:41 UTC

Return-Path: <janl@tail-f.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 3C17DC159480; Fri, 5 Aug 2022 01:41:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.908
X-Spam-Level:
X-Spam-Status: No, score=-1.908 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R6vhhwWsnk7D; Fri, 5 Aug 2022 01:41:13 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 9AB88C157B47; Fri, 5 Aug 2022 01:41:13 -0700 (PDT)
Received: from smtpclient.apple (213-67-237-150-no99.tbcn.telia.com [213.67.237.150]) by mail.tail-f.com (Postfix) with ESMTPSA id A19911AE02BD; Fri, 5 Aug 2022 10:41:10 +0200 (CEST)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\))
From: Jan Lindblad <janl@tail-f.com>
In-Reply-To: <21550.1659654070@localhost>
Date: Fri, 05 Aug 2022 10:41:10 +0200
Cc: "Anima@ietf.org" <anima@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <D335747C-1416-4E02-B430-239F860AC476@tail-f.com>
References: <DU0PR10MB5196F26C92DD2F266A4FAC28F3949@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM> <365823.1658933390@dooku> <DU0PR10MB5196ADB3702B7417B0589555F3979@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM> <446675.1659033968@dooku> <DU0PR10MB51966008D0EA49AC6FCD3FB9F3999@DU0PR10MB5196.EURPRD10.PROD.OUTLOOK.COM> <539974.1659103385@dooku> <YuhrI/iINFJxPOC7@faui48e.informatik.uni-erlangen.de> <32336.1659550668@localhost> <58217DD1-D5C2-4C99-BDF9-5BA5B252AE56@tail-f.com> <21550.1659654070@localhost>
To: Michael Richardson <mcr@sandelman.ca>
X-Mailer: Apple Mail (2.3696.120.41.1.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/745zQHcS0ZrfzoM96jna_npGGVY>
Subject: Re: [netmod] [Anima] mcr's YANG question raised during the ANIMA WG session
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.39
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, 05 Aug 2022 08:41:18 -0000

Michael,

Comments inline.

> On 5 Aug 2022, at 01:01, Michael Richardson <mcr@sandelman.ca> wrote:
> 
> Thank you for very much for the reply.
> 
> Jan Lindblad <janl@tail-f.com> wrote:
>> I had a look at your test example. The example is invalid, but pyang
>> fails to detect the error and overwrites some internal structures, with
>> the result below. The root cause of the problem is this:
> 
> ...
> 
>> Each one of the two uses statement brings in a "container voucher"
>> (with partly different content) at this point in the schema. That is an
>> attempt at a duplicate definition of voucher, which is an error.
> 
> okay, so it partly works, which is an error, and I'll see if I can make that
> into a test case for pyang.

Very good.

> BUT:
>   The goal is exactly to be able to combine two extensions to RFC8366 into a
>   new module that has both extensions.  Is there another way to do this?
> 
> Puting them into two containers does not accomplish the goal, because now you
> have two expires-on, ...

Of course. I just added the containers to show that pyang could understand the modules once the modeling error was removed. Just to clarify what was going on.

>> Pyang
>> misses this, and overwrites one voucher object with the next, losing
>> some of the content.
> 
>> By placing the two uses statements into separate containers, pyang is
>> able to successfully make a tree:
> 
> ...
> 
>> Normally in YANG, it wouldn't be hard to to let modules "B" and "C"
>> augment module "A" independently. But here you are working with
>> groupings in such a way that both "B" and "C" build up a complete
>> grouping with everything in "A". When "D" tries to use both "B" and
>> "C", there is inevitably unwanted duplication.
> 
>> If instead, "B" and "C"
>> just defined their little contributions, "D" could import groupings
>> from "A", "B" and "C" and compose them as desired.
> 
> The reason I am asking this question now, and proposing this example now, is
> so that if there is a better way to build "B" and "C" then we need to know
> about that *now*
> 
> I see that you have proposed a different way, which I will attempt to work
> through.  Fortunately, we still have time to fix some things.

Feel free to reach out offline for discussion and review.

Best Regards,
/jan