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

"Jernej Tuljak" <jernej.tuljak@mg-soft.si> Tue, 23 August 2016 14: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 C4BFF12DA11 for <netmod@ietfa.amsl.com>; Tue, 23 Aug 2016 07:17:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.148
X-Spam-Level:
X-Spam-Status: No, score=-1.148 tagged_above=-999 required=5 tests=[BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.548, SPF_PASS=-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 0227euPdsvdD for <netmod@ietfa.amsl.com>; Tue, 23 Aug 2016 07:17:18 -0700 (PDT)
Received: from galileo.mg-soft.si (gate.mg-soft.si [212.30.73.66]) by ietfa.amsl.com (Postfix) with ESMTP id 9E44312D186 for <netmod@ietf.org>; Tue, 23 Aug 2016 07:13:27 -0700 (PDT)
Received: from jernejthpPC (tp-x61t.mg-soft.si [10.0.0.222]) by galileo.mg-soft.si (Postfix) with ESMTP id A07BEC417623 for <netmod@ietf.org>; Tue, 23 Aug 2016 16:13:25 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.10.3 galileo.mg-soft.si A07BEC417623
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mg-soft.si; s=default; t=1471961605; bh=BkeQc2InkgrgjF27fPRx5CpeWYEvO9xVQCHoqY8M314=; h=From:To:Subject:Date:From; b=M/oRmogZYg2LQVd4zs//2owlF414F2EzddslsJHLQZKjl695BXEn2490adpWxS105 twVuAyRiRZaaOlkmx+vUmCgQT++FKpX1ZWdl5HSmcdH6Ak056k05TC7TCUdhwJZdFb q5lOZjodxrCUyuX2aIyulw73VZomBNiqoal6Od0VToeSPowAanf6XjVr/jBAmZNmMR mav8B7b0llktjhASv/OE6vhoejni70wRXRvmIRq7i0/kQuEHKykgpfiScZxV33H03g Cdg2ewdo8gUcsg7BLMOal2wV5UeT/mfVDBbFRrUmdkmvJUNzZs9iMJOMSw+BUUoYZn DvtWKqddVz4Jw==
From: Jernej Tuljak <jernej.tuljak@mg-soft.si>
To: netmod@ietf.org
Date: Tue, 23 Aug 2016 16:13:23 +0200
Message-ID: <062e01d1fd48$82309670$8691c350$@mg-soft.si>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_062F_01D1FD59.45BA50D0"
X-Mailer: Microsoft Outlook 15.0
Content-Language: sl
Thread-Index: AdH9PDOosJZHyj+xTeCmHE6QS46nDg==
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/qwkMR2dMLsUY3QUqVgPVU8HbY4Q>
Subject: [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: Tue, 23 Aug 2016 14:17:25 -0000

Hi,

 

this is a YANG 1, not 1.1 question. 

 

For the following example:

 

module main {

    namespace "uri:main";

    prefix "m";

    include a;

    include b;

}

 

submodule a {

    belongs-to main {

        prefix "a";

    }

    include b;

    container top {

        leaf top-leaf {

            type string;

        }

        uses foo;

    }    

}

 

submodule b {

    belongs-to main {

        prefix "b";

    }

    grouping foo {

        leaf some-leaf {

            type leafref {

                path "/top/top-leaf";

            }

        }

    }

}

 

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? 

 

Jernej