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

"Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco)" <mciglan@cisco.com> Wed, 15 February 2017 14:56 UTC

Return-Path: <mciglan@cisco.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 D50AF12966B for <netmod@ietfa.amsl.com>; Wed, 15 Feb 2017 06:56:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.522
X-Spam-Level:
X-Spam-Status: No, score=-14.522 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, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com
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 gMXIRhwnt8k6 for <netmod@ietfa.amsl.com>; Wed, 15 Feb 2017 06:56:47 -0800 (PST)
Received: from alln-iport-1.cisco.com (alln-iport-1.cisco.com [173.37.142.88]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 627DB1294E8 for <netmod@ietf.org>; Wed, 15 Feb 2017 06:56:47 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4713; q=dns/txt; s=iport; t=1487170607; x=1488380207; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AiyKlfiP2kugbVPAwG5XRd7A6YhfmWcZKKHc46BurCg=; b=mM5sJlMl5fZIz1VdjNIyLmw1NkF7s7UhcB00gB38DwgP6Z/YuZxUe0lP 4CzkkpGiNbzCg20LfpIdgrnM3KOeGeqVvUfJT9f6a5QeVj8KtlR5XqA3E SfLrUfLAO9sLjteOiHZ3EkT/oWZdeejX7TTYN0TDbVSJQr07IhB6D6puC Y=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0CuAQBca6RY/51dJa1eGQEBAQEBAQEBAQEBBwEBAQEBg1JhgQkHg1KCTIc8khCDfwEDkTOCDB8LhS5KAoISPxgBAgEBAQEBAQFiKIRwAQEBAwEBAQIcBEoLBQcEAgEIEQQBAQEDBh4EAw8QCAsUCQgCBAENBYljCA6vdQyCJItgAQEBAQEBAQEBAQEBAQEBAQEBAQEBGAWBDIowgj2BegEBGwcrBoJPgl4Fm3cBGpF5kQaTFgEfOIEAURU9hkN1AYdZgSGBDAEBAQ
X-IronPort-AV: E=Sophos;i="5.35,166,1484006400"; d="scan'208";a="385949819"
Received: from rcdn-core-6.cisco.com ([173.37.93.157]) by alln-iport-1.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2017 14:56:46 +0000
Received: from XCH-ALN-014.cisco.com (xch-aln-014.cisco.com [173.36.7.24]) by rcdn-core-6.cisco.com (8.14.5/8.14.5) with ESMTP id v1FEuk0j013511 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 15 Feb 2017 14:56:46 GMT
Received: from xch-aln-014.cisco.com (173.36.7.24) by XCH-ALN-014.cisco.com (173.36.7.24) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 15 Feb 2017 08:56:45 -0600
Received: from xch-aln-014.cisco.com ([173.36.7.24]) by XCH-ALN-014.cisco.com ([173.36.7.24]) with mapi id 15.00.1210.000; Wed, 15 Feb 2017 08:56:45 -0600
From: "Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco)" <mciglan@cisco.com>
To: Jernej Tuljak <jernej.tuljak@mg-soft.si>, 'Ladislav Lhotka' <lhotka@nic.cz>
Thread-Topic: [netmod] Yang 1.1 change: Allow type "empty" in a key.
Thread-Index: AQHShsjv5qSguYqtGEOf5dz8Fc9fB6Fo+6CigAFEowCAAAZhAIAAHhoA///EyXI=
Date: Wed, 15 Feb 2017 14:56:45 +0000
Message-ID: <1487170617280.28096@cisco.com>
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>
In-Reply-To: <109901d28786$ddf2ccd0$99d86670$@mg-soft.si>
Accept-Language: sk-SK, en-US
Content-Language: sk-SK
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.61.161.117]
Content-Type: text/plain; charset="windows-1250"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/kK6AYYZuR5usc7lCpNYX1qNfhYk>
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 14:56:49 -0000

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.
________________________________________
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
>
>
>
>