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

"Jernej Tuljak" <jernej.tuljak@mg-soft.si> Wed, 15 February 2017 10:17 UTC

Return-Path: <jernej.tuljak@mg-soft.si>
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 42341129ACD for <netmod@ietfa.amsl.com>; Wed, 15 Feb 2017 02:17:02 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mg-soft.si
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 9peYH7T5lvnw for <netmod@ietfa.amsl.com>; Wed, 15 Feb 2017 02:17:00 -0800 (PST)
Received: from galileo.mg-soft.si (gate.mg-soft.si [212.30.73.66]) by ietfa.amsl.com (Postfix) with ESMTP id AF9A0129ACC for <netmod@ietf.org>; Wed, 15 Feb 2017 02:16:59 -0800 (PST)
Received: from jernejthpPC (tp-x61t.mg-soft.si [10.0.0.222]) by galileo.mg-soft.si (Postfix) with ESMTP id 7E7C2C417623; Wed, 15 Feb 2017 11:16:54 +0100 (CET)
DKIM-Filter: OpenDKIM Filter v2.10.3 galileo.mg-soft.si 7E7C2C417623
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mg-soft.si; s=default; t=1487153814; bh=oJUaZFNAjBXjzlq7T6IycVGGHQtm5qBatWWGUng6aDE=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=IE3TMNhSV2PVjEPE+z2I5DRAkrd9PbpMEOEkTzy2443bKrhZ3IxrqGetJN7zjssg4 pmZuS8NOpSDRCCKqnn6B3NSaV8O+ZndBQceCmpF0Zegw1SRusqJPGp3TlEJ4M2vVX6 3+ZsPZwAn6etqqIzyJJEZCmjs0aPnE04AmDlpRIfT/R+OcSNMjeTUpLcoNjw3A2nVM 3lUJWMB9vpc1WQ2hl3GT6SkY0lF5NBAh4iweob8mhNAqh3/oom2hThNm1MaZC9BuVt TVUSkaR/iaqJMBIak5ku2GQyJ/Ulp3S/0tQekX6mZBHID6YtfWmGVkfdJ2WJbWEreu W99omy/2wrBwA==
From: Jernej Tuljak <jernej.tuljak@mg-soft.si>
To: 'Alex Campbell' <Alex.Campbell@Aviatnet.com>, "'Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco)'" <mciglan@cisco.com>
References: <1487080134376.87476@cisco.com> <1487105934602.29661@Aviatnet.com>
In-Reply-To: <1487105934602.29661@Aviatnet.com>
Date: Wed, 15 Feb 2017 11:16:52 +0100
Message-ID: <106501d28774$a0b5a2a0$e220e7e0$@mg-soft.si>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_1066_01D2877D.027B6A30"
X-Mailer: Microsoft Outlook 15.0
Content-Language: sl
Thread-Index: AQMWBYeP7gKNQW8o/AOiwx9yhMffuQMpt1hYnsmLMYA=
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/qbtxNbcXt_-WvRuVUGP6tabqsHQ>
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.
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 10:17:02 -0000

Plus, "empty keys" were aready allowed in YANG 1.

 

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.

 

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 <mailto:netmod-bounces@ietf.org> > on behalf of Martin Ciglan -X (mciglan - PANTHEON TECHNOLOGIES at Cisco) <mciglan@cisco.com <mailto:mciglan@cisco.com> >
Sent: Wednesday, 15 February 2017 2:48 a.m.
To: netmod@ietf.org <mailto: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