Re: [netmod] Is this leafref path example valid in YANG 1?

Martin Bjorklund <mbj@tail-f.com> Fri, 26 August 2016 14:18 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 8B3D112B03B for <netmod@ietfa.amsl.com>; Fri, 26 Aug 2016 07:18:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.449
X-Spam-Level:
X-Spam-Status: No, score=-2.449 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.548, 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 UlEJVJSUn4qG for <netmod@ietfa.amsl.com>; Fri, 26 Aug 2016 07:18:38 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 70B7112B05F for <netmod@ietf.org>; Fri, 26 Aug 2016 07:09:27 -0700 (PDT)
Received: from localhost (unknown [173.38.220.42]) by mail.tail-f.com (Postfix) with ESMTPSA id D57761AE018C; Fri, 26 Aug 2016 16:09:24 +0200 (CEST)
Date: Fri, 26 Aug 2016 16:08:29 +0200
Message-Id: <20160826.160829.966689922555224217.mbj@tail-f.com>
To: j.schoenwaelder@jacobs-university.de
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <20160826125016.GA32908@elstar.local>
References: <062e01d1fd48$82309670$8691c350$@mg-soft.si> <20160826125016.GA32908@elstar.local>
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/22ifQGZmaGzBVfpxR2C_f7CVPP8>
Cc: netmod@ietf.org
Subject: Re: [netmod] Is this leafref path example valid in YANG 1?
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: Fri, 26 Aug 2016 14:18:43 -0000

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> wrote:
> On Tue, Aug 23, 2016 at 04:13:23PM +0200, Jernej Tuljak wrote:
> > Hi,
> > 
> > this is a YANG 1, not 1.1 question. 
> 
> [...]
>  
> > Note the "path" expression that is referencing names that do not
> > seem to be in b's scope. Is this a valid "path" expression (names
> > resolved upon usage) or should all names inside the "grouping" be
> > resolved where the "grouping" is defined?
> 
> RFC 6020 says in section 7.12:
> 
>    The effect of a "uses" reference to a grouping is that the nodes
>    defined by the grouping are copied into the current schema tree, and
>    then updated according to the "refine" and "augment" statements.
> 
>    The identifiers defined in the grouping are not bound to a namespace
>    until the contents of the grouping are added to the schema tree via a
>    "uses" statement that does not appear inside a "grouping" statement,
>    at which point they are bound to the namespace of the current module.
> 
> This makes me believe that the uses statement should resolve things
> to this:
> 
> submodule a {
> 
>     belongs-to main {
>         prefix "a";
>     }
>     include b;
> 
>     container top {
>         leaf top-leaf {
>             type string;
>         }
>         leaf some-leaf {
>             type leafref {
>                 path "/top/top-leaf";
>             }
>         }
>     }
> }
> 
> Other opinions? The text quoted from RFC 6020 only talks specifically
> about identifiers but I would assume that the same late binding applies
> to path statement arguments.

This is issue #Y05.  The problem is that is not clear from RFC 6020
what the right answer is.

SO, the question was "is this legal YANG 1?", and the answer is
"unclear".  With the follow-up answer "if you need this, use YANG
1.1".



/martin