Re: [yang-doctors] Identities vs enums

Ladislav Lhotka <lhotka@nic.cz> Thu, 29 August 2019 12:33 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: yang-doctors@ietfa.amsl.com
Delivered-To: yang-doctors@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1C0D3120088 for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 05:33:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.998
X-Spam-Level:
X-Spam-Status: No, score=-6.998 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=nic.cz
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 DAuTTdi0xul1 for <yang-doctors@ietfa.amsl.com>; Thu, 29 Aug 2019 05:33:33 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (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 7569712007C for <yang-doctors@ietf.org>; Thu, 29 Aug 2019 05:33:33 -0700 (PDT)
Received: from birdie (unknown [IPv6:2001:1488:fffe:6:a744:2697:a0ec:a420]) by mail.nic.cz (Postfix) with ESMTPSA id 6693013FC6D; Thu, 29 Aug 2019 14:33:31 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1567082011; bh=bqw3uAzjRR8JNcEM4PjE2RWUn8W2YptCt0NKgR3p0hY=; h=From:To:Date; b=bl8y44tgY98n0ic3KFKQSbPHT4L94rk5Z8sCTUB6E5eSrTgC2a6oB4nERi/a19cek BpbHGfGPky7LgmERD7krNTHXVGeO3zXOphKvQOeAFumelIEb917gsinNEi17mbZ/8q AbEO3sI/r+LlsmqEDLHEkGd5xhpeOB+Cjk5tZtfI=
Message-ID: <312cc059c38fe87727fda70f4f1c88ba0a165f23.camel@nic.cz>
From: Ladislav Lhotka <lhotka@nic.cz>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: yang-doctors@ietf.org
Date: Thu, 29 Aug 2019 14:33:31 +0200
In-Reply-To: <20190829.141333.409220577655745011.mbj@tail-f.com>
References: <MN2PR11MB4366B7D24FF907FE8E0802E9B5A20@MN2PR11MB4366.namprd11.prod.outlook.com> <c0c6bb8f1fe8ebe910c09ff764f43a2d84907d42.camel@nic.cz> <20190829.141333.409220577655745011.mbj@tail-f.com>
Organization: CZ.NIC
Content-Type: text/plain; charset="UTF-8"
User-Agent: Evolution 3.32.4
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Virus-Scanned: clamav-milter 0.100.3 at mail.nic.cz
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/yang-doctors/TYpQpwntjy6HaHJlG9holGDss6o>
Subject: Re: [yang-doctors] Identities vs enums
X-BeenThere: yang-doctors@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email list of the yang-doctors directorate <yang-doctors.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/yang-doctors/>
List-Post: <mailto:yang-doctors@ietf.org>
List-Help: <mailto:yang-doctors-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/yang-doctors>, <mailto:yang-doctors-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Aug 2019 12:33:36 -0000

On Thu, 2019-08-29 at 14:13 +0200, Martin Bjorklund wrote:
> Ladislav Lhotka <lhotka@nic.cz>; wrote:
> > On Thu, 2019-08-29 at 10:24 +0000, Rob Wilton (rwilton) wrote:
> 
> > > I doubt that this is the first time that this has come up …
> 
> > >  
> 
> > > draft-ietf-netmod-intf-ext-yang-07, defines 3 identities (along with a
> base
> 
> > > identity) for loopback configuration: “loopback-internal”, “loopback-line” 
> and
> 
> > > “loopback-connector”.
> 
> > >  
> 
> > > One of the reviewers is complaining that the “loopback-“ prefix in the
> 
> > > identity is redundant and noisy.  I.e. he doesn’t like having to write
> 
> > > loopback=’loopback-internal’, and would like to be able to write
> 
> > > loopback=’internal’ instead.
> 
> > >  
> 
> > > His main suggestion is to move these loopback (or perhaps just the
> identities)
> 
> > > to a separate YANG module so that they don’t need to define a “loopback-“
> 
> > > prefix.
> 
> > >  
> 
> > > There seem to be some choices here:
> 
> > > (1) Keep with identities with a "loopback-" prefix.  This causes
> 
> > > loopback='loopback-internal'
> 
> > > (2) Keep with identities, but loose the common prefix, i.e. the identities
> 
> > > become "internal", "line", "connector".  Given the size of the module, the
> 
> > > likelihood of an identity naming clash in future seems quite small, but
> they
> 
> > > are somewhat generic terms.
> 
> > > (3) Use shorter identity names, but also put them in a separate types
> module
> 
> > > (as requested by the reviewer).
> 
> > > (4) Use an enum rather than identities.  Although this has the potential
> issue
> 
> > > that the enum cannot be extended (which I’m wondering if this is something
> 
> > > that we should consider changing in the hypothetical YANG Next).
> 
> > 
> 
> > I would go for (2).
> 
> 
> +1  (provided you really need the flexibility!)
> 
> > In fact, the namespace for identity names probably needn't be module-wide, I
> 
> > think it would be perfectly fine to require unique names only for identities
> 
> > derived from the same base.
> 
> 
> Yes that would have worked as well.  But it would have a big impact on
> implementations that use the fact that they are unique...

Yes, although I think the required changes shouldn't be too big. On the other
hand, it would be backward compatible in terms of existing modules.   

Lada

> 
> 
> /martin
> 
> 
> 
> > 
> 
> > Lada
> 
> > 
> 
> > >  
> 
> > > Personally, I’m toying with changing to 4 or perhaps 2.  I’m not keen on
> 3.
> 
> > >  
> 
> > > Any thoughts or opinions from the YANG doctors?
> 
> > >  
> 
> > > Thanks,
> 
> > > Rob
> 
> > >  
> 
> > > _______________________________________________
> 
> > > yang-doctors mailing list
> 
> > > yang-doctors@ietf.org
> 
> > > https://www.ietf.org/mailman/listinfo/yang-doctors
> 
> > -- 
> 
> > Ladislav Lhotka
> 
> > Head, CZ.NIC Labs
> 
> > PGP Key ID: 0xB8F92B08A9F76C67
> 
> > 
> 
> > _______________________________________________
> 
> > yang-doctors mailing list
> 
> > yang-doctors@ietf.org
> 
> > https://www.ietf.org/mailman/listinfo/yang-doctors
> 
-- 
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67