Re: [netmod] Proposal to enhance the YANG tree output

Martin Bjorklund <mbj@tail-f.com> Thu, 14 September 2017 17:50 UTC

Return-Path: <mbj@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 A91701323B8 for <netmod@ietfa.amsl.com>; Thu, 14 Sep 2017 10:50:00 -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, SPF_PASS=-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 L86__RLUT7vY for <netmod@ietfa.amsl.com>; Thu, 14 Sep 2017 10:49:59 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id E725B1321DF for <netmod@ietf.org>; Thu, 14 Sep 2017 10:49:58 -0700 (PDT)
Received: from localhost (h-40-225.A165.priv.bahnhof.se [94.254.40.225]) by mail.tail-f.com (Postfix) with ESMTPSA id 32DB91AE0383; Thu, 14 Sep 2017 19:49:58 +0200 (CEST)
Date: Thu, 14 Sep 2017 19:50:37 +0200 (CEST)
Message-Id: <20170914.195037.593298963545596882.mbj@tail-f.com>
To: andy@yumaworks.com
Cc: jclarke@cisco.com, netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <CABCOCHQZ4zJ3p_4oB1Pu=1H60btzrccqTx7rUtsRsF0reXgrYw@mail.gmail.com>
References: <9d84d068-29ba-8e89-394f-b7f6a5272adc@cisco.com> <CABCOCHQZ4zJ3p_4oB1Pu=1H60btzrccqTx7rUtsRsF0reXgrYw@mail.gmail.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/orgGv7aPTsAjF8cmWBc0hpubO1Q>
Subject: Re: [netmod] Proposal to enhance the YANG tree output
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: Thu, 14 Sep 2017 17:50:01 -0000

Andy Bierman <andy@yumaworks.com> wrote:
> Hi,
> 
> 
> Actually I liked the early pyang output that was concise and easy to
> remember.
> The current format gets very cluttered and there are too many little symbols
> to remember them all.

I agree with Andy.  I also did some experiments with printing
enumerations, and they work ok for small enums.  But once you have
more than a handful they do tend to clutter the output.  Even worse so
for trees that go into RFCs (where lines need to be < 70 characters).

Lada is sometimes using a format with even less information, where he
has removed all type information, focusing more on the structure.


/martin



> 
> 
> Andy
> 
> 
> On Thu, Sep 14, 2017 at 8:33 AM, Joe Clarke <jclarke@cisco.com> wrote:
> 
> > I've been hacking on pyang, and I changed tree.py to add the enum values
> > for enumeration types and identiyref bases for identityref types.  Here
> > is an example:
> >
> > module: yang-catalog
> >     +--rw catalog
> >        +--rw modules
> >        |  +--rw module* [name revision organization]
> >        |     +--rw name                     yang:yang-identifier
> >        |     +--rw revision                 union
> >        |     +--rw organization             string
> >        |     +--rw ietf
> >        |     |  +--rw ietf-wg?   string
> >        |     +--rw namespace                inet:uri
> >        |     +--rw schema?                  inet:uri
> >        |     +--rw generated-from?          enumeration [mib, code,
> > not-applicable, native]
> >        |     +--rw maturity-level?          enumeration [ratified,
> > adopted, initial, not-applicable]
> > ...
> >                                +--rw protocols
> >                                |  +--rw protocol* [name]
> >                                |     +--rw name
> > identityref -> protocol
> > ...
> >
> > My questions are:
> >
> > 1. Is this useful?
> >
> > 2. If so, can this be added to pyang (happy to submit a PR) and
> > draft-ietf-netmod-yang-tree-diagrams?
> >
> > 3. What changes to the output format would you recommend?
> >
> > Thanks.
> >
> > Joe
> >
> > _______________________________________________
> > netmod mailing list
> > netmod@ietf.org
> > https://www.ietf.org/mailman/listinfo/netmod
> >