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

Michael Richardson <mcr+ietf@sandelman.ca> Mon, 14 November 2022 00:29 UTC

Return-Path: <mcr+ietf@sandelman.ca>
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 162BCC14F731; Sun, 13 Nov 2022 16:29:33 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level:
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001] 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 LmZ5_LoTlzqX; Sun, 13 Nov 2022 16:29:28 -0800 (PST)
Received: from relay.sandelman.ca (relay.cooperix.net [IPv6:2a01:7e00:e000:2bb::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EFE2FC14CE42; Sun, 13 Nov 2022 16:29:27 -0800 (PST)
Received: from dyas.sandelman.ca (unknown [75.98.19.151]) by relay.sandelman.ca (Postfix) with ESMTPS id 0D3E91F44D; Mon, 14 Nov 2022 00:29:24 +0000 (UTC)
Received: by dyas.sandelman.ca (Postfix, from userid 1000) id A1838A0B06; Sun, 13 Nov 2022 23:38:16 +0000 (GMT)
Received: from dyas (localhost [127.0.0.1]) by dyas.sandelman.ca (Postfix) with ESMTP id 9E3F1A0ADF; Sun, 13 Nov 2022 18:38:16 -0500 (EST)
From: Michael Richardson <mcr+ietf@sandelman.ca>
To: Jan Lindblad <janl@tail-f.com>, "Anima@ietf.org" <anima@ietf.org>, "netmod@ietf.org" <netmod@ietf.org>
In-reply-to: <58217DD1-D5C2-4C99-BDF9-5BA5B252AE56@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>
Comments: In-reply-to Jan Lindblad <janl@tail-f.com> message dated "Thu, 04 Aug 2022 12:22:43 +0200."
X-Mailer: MH-E 8.6+git; nmh 1.7+dev; GNU Emacs 26.3
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg="pgp-sha512"; protocol="application/pgp-signature"
Date: Sun, 13 Nov 2022 18:38:16 -0500
Message-ID: <809554.1668382696@dyas>
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/stbfGjly7tp1Zw7aFVePstik9O4>
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: Mon, 14 Nov 2022 00:29:33 -0000

Hi,  I completed two examples, one using the augment method that we were
using, which you pointed out was broken.   Thank you for helping with this,
and I hope you have a moment to review my test files... probably there is a
*third* way that works better.

What we want is to be able to write extensions in different RFCs, and then be
able to compose them together easily.

And yes, I get errors:

MODULE D
module-D2.yang:14: warning: imported module "module-A" not used
module-D2.yang:37: error: the 'yang-data' extension must have exactly one child that is a container
module-D2.yang:39: error: there is already a child node to "module-D2-artifact" at module-D2.yang:37 with the name "module-A-things" defined at module-D2.yang:39 (at module-A.yang:30)
module-D2.yang:47: error: node module-D2::module-B2-things is not found
module-D2.yang:55: error: there is already a child node to "module-D2-grouping" at module-D2.yang:42 with the name "module-A-things" defined at module-D2.yang:45 (at module-A.yang:30)
module-D2.yang:56: error: node module-D2::module-C2-things is not found

My first example (D1) created new grouping, which I import separately, but do not augment.
But, the results has quite a bit of unwanted "structure":

MODULE D
module: module-D1

  grouping module-D1-grouping:
    +-- module-D1-things
       +-- module-A-things
       |  +-- attribute-A-Alpha?   binary
       +-- module-B-things
       |  +-- module-A-things
       |  |  +-- attribute-A-Alpha?   binary
       |  +-- attribute-B-Alpha?   binary
       +-- module-C1-things
       |  +-- module-A-things
       |  |  +-- attribute-A-Alpha?   binary
       |  +-- attribute-C1-Gamma?   binary
       +-- attribute-D-Delta?   binary

Maybe there is a way to fix this to be saner.
It's all in a git repo,   https://github.com/mcr/yang-augment-test

The file "practice1.sh" uses the method with multiple uses, which I think it
was has been recommended, but looks weird above:

  grouping module-D1-grouping {
    description "Grouping for module D1";
    container module-D1-things {
      uses vA:module-A-grouping;
      uses vB:module-B-grouping;
      uses vC1:module-C1-grouping;
      leaf attribute-D-Delta {
        type binary;
        description "Delta";
      }
    }
  }

The file practice2.sh uses the old method we were using with augment, which
does *not* work.



--
Michael Richardson <mcr+IETF@sandelman.ca>, Sandelman Software Works
 -= IPv6 IoT consulting =-