Re: [netmod] Yang 1.1 change: Allow type "empty" in a key.

Ladislav Lhotka <lhotka@nic.cz> Wed, 15 February 2017 15:00 UTC

Return-Path: <lhotka@nic.cz>
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 99F8A1295FE for <netmod@ietfa.amsl.com>; Wed, 15 Feb 2017 07:00:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7
X-Spam-Level:
X-Spam-Status: No, score=-7 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, RP_MATCHES_RCVD=-0.001, URIBL_BLOCKED=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 xO-iuoXYAzVI for <netmod@ietfa.amsl.com>; Wed, 15 Feb 2017 07:00:21 -0800 (PST)
Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9CE1A129552 for <netmod@ietf.org>; Wed, 15 Feb 2017 07:00:21 -0800 (PST)
Received: from [IPv6:2001:718:1a02:1:20d1:e797:6a9f:dc8f] (unknown [IPv6:2001:718:1a02:1:20d1:e797:6a9f:dc8f]) by mail.nic.cz (Postfix) with ESMTPSA id E38E260AC3; Wed, 15 Feb 2017 16:00:19 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1487170820; bh=Hy1Q/Kc2/6xMb0Y1B1o3l3KKG42t3z+mAnqZ5SNMC08=; h=From:Date:To; b=NlIYTXSN7HiRRu2kRlwN2othUgX+f7XRitRXcB1YukMm66LnMX5tT+5sohpL/9Sqd hC0kaD8ry5kM4erxejpUObrdh2+Y4KP5UzM/32vJLyMoLb5noIux/FNEbnDNc5qECY zlxONobhfbTl28dcjHvX9k1sgsM/v4llELc7GaCE=
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\))
From: Ladislav Lhotka <lhotka@nic.cz>
In-Reply-To: <1487170617280.28096@cisco.com>
Date: Wed, 15 Feb 2017 16:00:25 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <03EF8E64-20A2-4D9B-9B86-38C2C8862527@nic.cz>
References: <1487080134376.87476@cisco.com> <1487105934602.29661@Aviatnet.com> <106501d28774$a0b5a2a0$e220e7e0$@mg-soft.si> <C3D06898-E9AF-4AB1-9982-146550E4A6E2@nic.cz> <109901d28786$ddf2ccd0$99d86670$@mg-soft.si> <1487170617280.28096@cisco.com>
To: "Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco)" <mciglan@cisco.com>
X-Mailer: Apple Mail (2.3259)
X-Virus-Scanned: clamav-milter 0.99.2 at mail
X-Virus-Status: Clean
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/K6EvycTDZkxhZrmxOYGn1hKXtUs>
Cc: "Igor Foltin -X (ifoltin - PANTHEON TECHNOLOGIES at Cisco)" <ifoltin@cisco.com>, "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [netmod] Yang 1.1 change: Allow type "empty" in a key.
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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: Wed, 15 Feb 2017 15:00:23 -0000

> On 15 Feb 2017, at 15:56, Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco) <mciglan@cisco.com> wrote:
> 
> Thanks for information, but still, from implementation point of view,
> we've got empty keys in Map structures, searching for values...
> that was my point.

So what's your problem with them?

Lada

> ________________________________________
> Od: Jernej Tuljak <jernej.tuljak@mg-soft.si>
> Odoslané: 15. februára 2017 13:27
> Komu: 'Ladislav Lhotka'
> Kópia: 'Alex Campbell'; Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco); Igor Foltin -X (ifoltin - PANTHEON TECHNOLOGIES at Cisco); netmod@ietf.org
> Predmet: RE: [netmod] Yang 1.1 change:  Allow type "empty" in a key.
> 
>> -----Original Message-----
>> From: Ladislav Lhotka [mailto:lhotka@nic.cz]
>> Sent: Wednesday, February 15, 2017 11:40 AM
>> To: Jernej Tuljak <jernej.tuljak@mg-soft.si>
>> Cc: Alex Campbell <Alex.Campbell@Aviatnet.com>; Martin Ciglan -X (mciglan
>> - PANTHEON TECHNOLOGIES at Cisco) <mciglan@cisco.com>; Igor Foltin -X
>> (ifoltin - PANTHEON TECHNOLOGIES at Cisco) <ifoltin@cisco.com>;
>> netmod@ietf.org
>> Subject: Re: [netmod] Yang 1.1 change: Allow type "empty" in a key.
>> 
>> 
>>> On 15 Feb 2017, at 11:16, Jernej Tuljak <jernej.tuljak@mg-soft.si> wrote:
>>> 
>>> Plus, "empty keys" were aready allowed in YANG 1.
>> 
>> Well, keys with "empty" type were not allowed. What you are saying is that
>> the same (dubious) effect can be achieved in other ways that were
>> permitted in YANG 1.
> 
> Indeed. I meant »empty keys«. Quoting is hard. :)
> 
> Jernej
> 
>> Note also that while if in XML encoding an empty leaf
>> and a leaf containing string of length 0 look the same, in JSON encoding they
>> are different:
>> 
>> "first": [null]
>> 
>> versus
>> 
>> "first": ""
>> 
>>> 
>>> module empty-key {
>>>  namespace "org:example:empty-key";
>>>  prefix "ek";
>>> 
>>>  container stuff {
>>>    list item {
>>>      key "first second";
>>>      leaf first {
>>>        type string {
>>>          length 0;
>>>        }
>>>      }
>>>      leaf second {
>>>        type string {
>>>          pattern '.{0}';
>>>        }
>>>      }
>>>    }
>>>  }
>>> }
>>> 
>>> Therefore this change removed a redundant (perhaps even broken) rule.
>> 
>> Agreed.
>> 
>> Lada
>> 
>>> 
>>> https://www.ietf.org/mail-archive/web/netmod/current/msg16763.html
>>> Jernej
>>> 
>>> From: netmod [mailto:netmod-bounces@ietf.org] On Behalf Of Alex
>> Campbell
>>> Sent: Tuesday, February 14, 2017 9:59 PM
>>> To: Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco)
>> <mciglan@cisco.com>
>>> Cc: Igor Foltin -X (ifoltin - PANTHEON TECHNOLOGIES at Cisco)
>> <ifoltin@cisco.com>; netmod@ietf.org
>>> Subject: Re: [netmod] Yang 1.1 change: Allow type "empty" in a key.
>>> 
>>> Hi,
>>> 
>>> It means exactly what the summary says. In YANG 1.0 (RFC 6020) we have:
>>>   A leaf that is part of the key can be of any built-in or derived
>>>   type, except it MUST NOT be the built-in type "empty".
>>> and in YANG 1.1 (RFC 7950) we have:
>>>   A leaf that is part of the key can be of any built-in or
>>>   derived type.
>>> 
>>> In YANG 1.1, leaves of type "empty" are not disallowed from being keys.
>>> 
>>> Note that since leaves of type "empty" only convey information through
>> their presence or absence, and since
>>> key leaves must always be present, key leaves of type "empty" convey no
>> useful information.
>>> 
>>> Alex
>>> 
>>> 
>>> From: netmod <netmod-bounces@ietf.org> on behalf of Martin Ciglan -X
>> (mciglan - PANTHEON TECHNOLOGIES at Cisco) <mciglan@cisco.com>
>>> Sent: Wednesday, 15 February 2017 2:48 a.m.
>>> To: netmod@ietf.org
>>> Cc: Igor Foltin -X (ifoltin - PANTHEON TECHNOLOGIES at Cisco)
>>> Subject: [netmod] Yang 1.1 change: Allow type "empty" in a key.
>>> 
>>> Hi all
>>> 
>>> Yang 1.1 change:  Allow type "empty" in a key.
>>> 
>>> What is the meaning of this change? We're interested from
>> implementation point of view.
>>> 
>>>  Thanks
>>> 
>>>       Martin
>>> 
>>> _______________________________________________
>>> netmod mailing list
>>> netmod@ietf.org
>>> https://www.ietf.org/mailman/listinfo/netmod
>> 
>> --
>> Ladislav Lhotka, CZ.NIC Labs
>> PGP Key ID: 0xB8F92B08A9F76C67
>> 
>> 
>> 
>> 
> 
> 

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67