Re: [netmod] choice/case in tree diagrams

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Mon, 05 March 2018 12:50 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 4432B12D7ED for <netmod@ietfa.amsl.com>; Mon, 5 Mar 2018 04:50:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 ChABiGoYGKeP for <netmod@ietfa.amsl.com>; Mon, 5 Mar 2018 04:50:11 -0800 (PST)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7ABF712D778 for <netmod@ietf.org>; Mon, 5 Mar 2018 04:50:11 -0800 (PST)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id CA438CE1; Mon, 5 Mar 2018 13:50:09 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.217]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id n8I95giahTol; Mon, 5 Mar 2018 13:50:08 +0100 (CET)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Mon, 5 Mar 2018 13:50:09 +0100 (CET)
Received: from localhost (demetrius4.jacobs-university.de [212.201.44.49]) by hermes.jacobs-university.de (Postfix) with ESMTP id A03232015B; Mon, 5 Mar 2018 13:50:09 +0100 (CET)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius4.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id H_TS6-UqGhWV; Mon, 5 Mar 2018 13:50:09 +0100 (CET)
Received: from elstar.local (unknown [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 15A7920158; Mon, 5 Mar 2018 13:50:09 +0100 (CET)
Received: by elstar.local (Postfix, from userid 501) id C50D242622CA; Mon, 5 Mar 2018 13:50:08 +0100 (CET)
Date: Mon, 05 Mar 2018 13:50:08 +0100
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: netmod@ietf.org
Message-ID: <20180305125008.sm7izwuic65mhrti@elstar.local>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Martin Bjorklund <mbj@tail-f.com>, netmod@ietf.org
References: <20180305.122627.1715904795972526238.mbj@tail-f.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20180305.122627.1715904795972526238.mbj@tail-f.com>
User-Agent: NeoMutt/20171215
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/rA8nTPx6AMElAnB5Ywr9r2oZQZE>
Subject: Re: [netmod] choice/case in tree diagrams
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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, 05 Mar 2018 12:50:14 -0000

I prefer that the choice/case nodes do not have any flags since they
are not having a config true/false property on their own. And less
clutter is better.

/js

On Mon, Mar 05, 2018 at 12:26:27PM +0100, Martin Bjorklund wrote:
> Hi,
> 
> Lifting this issue to its own thread.
> 
> With this snippet:
> 
>     choice subnet {
>       case prefix-length {
>         leaf prefix-length {
>           type uint8;
>         }
>       }
>       case netmask {
>         leaf netmask {
>           type yang:dotted-quad;
>         }
>       }
>     }
> 
> pyang prints choice/case nodes like this:
> 
>      +--rw (subnet)?
>         +--:(prefix-length)
>         |  +--rw prefix-length?   uint8
>         +--:(netmask)
>            +--rw netmask?         yang:dotted-quad
> 
> With the syntax defined in the yang-tree document:
> 
>   <status>--<flags> <name><opts> <type> <if-features>
> 
> it means that the choice node has <flags> just like any other node (in
> this case "rw"), but the case node has "" as <flags>, and no space
> after the "--".
> 
> This is clearly inconsistent, and something needs to be fixed.
> 
> The current yang-tree document doesn't say that choice/case should be
> treated differently than other nodes.
> 
> Alternatives:
> 
>   1)  The document is correct, this is a bug in pyang, the output
>       should be:
> 
>      +--rw (subnet)?
>         +--rw :(prefix-length)
>         |  +--rw prefix-length?   uint8
>         +--rw :(netmask)
>            +--rw netmask?         yang:dotted-quad
> 
>   2)  Since the choice/case nodes are not present in the data tree,
>       they should not have any flags.  The document should be fixed to
>       allow empty flags so we have:
> 
>      +-- (subnet)?
>         +-- :(prefix-length)
>         |  +--rw prefix-length?   uint8
>         +-- :(netmask)
>            +--rw netmask?         yang:dotted-quad
> 
> 
> Note that the document is currently in AUTH48.
> 
> Something needs to be done in the document though, b/c it shows the
> current pyang output in an example.
> 
> 
> 
> /martin
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>