Re: [netmod] Query about augmenting module from submodule in YANG 1.0

Jan Lindblad <janl@tail-f.com> Mon, 07 August 2017 13:28 UTC

Return-Path: <janl@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 2499C13232B for <netmod@ietfa.amsl.com>; Mon, 7 Aug 2017 06:28:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, 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 BORJllEbAUOj for <netmod@ietfa.amsl.com>; Mon, 7 Aug 2017 06:27:58 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 7FD841321E3 for <netmod@ietf.org>; Mon, 7 Aug 2017 06:27:58 -0700 (PDT)
Received: from [10.147.40.56] (unknown [173.38.220.57]) by mail.tail-f.com (Postfix) with ESMTPSA id C305E1AE02EF; Mon, 7 Aug 2017 15:27:56 +0200 (CEST)
From: Jan Lindblad <janl@tail-f.com>
Message-Id: <85A1FF5A-EF0B-4278-B4FF-3FE431486B2C@tail-f.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_078050ED-65DF-4DFA-BEE0-3AB5488082C4"
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Date: Mon, 07 Aug 2017 15:27:49 +0200
In-Reply-To: <E3378E0605547F4E854DEE0CB1116AB020865B@gbcdcmbx03.intl.att.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
To: "Ivory, William" <wi274w@intl.att.com>
References: <E3378E0605547F4E854DEE0CB1116AB020865B@gbcdcmbx03.intl.att.com>
X-Mailer: Apple Mail (2.3273)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Ud2QETbQY3KkSwfXhgj2KQY-Rko>
Subject: Re: [netmod] Query about augmenting module from submodule in YANG 1.0
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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: Mon, 07 Aug 2017 13:28:01 -0000

The submodule concept in YANG 1.0 is, well, not very useful, and even less intuitive. That's why it saw major rework in YANG 1.1.

A YANG 1.0 submodule cannot reference the module that includes it, directly or indirectly. This is because in YANG 1.0 the symbols in other submodules of the same namespace are invisible to the submodule unless they are explicitly included. And parent modules can't be included by a submodule because that would lead to an inclusion loop. It is possible to reference (augment, etc) other sibling submodules, though. So if you split your modules cleverly, you might be able to resolve your referential constraints anyway. 

If you really want to take the submodule path, I'd recommend moving to YANG 1.1. In the interest of preserving the hair tone of IT-architects.

/jan

> We’re trying to solve a modularity problem with a YANG module by splitting it into submodules and augmenting the parent module from each submodule.  However, despite the wording below in YANG 1.0 section 7.15, we’ve found a couple of threads online with comments suggesting it’s only allowed in YANG 1.1?  Would appreciate clarification.
>  
> RFC 6020 section 7.15 suggests it is allowed:
>  
> ‘
>    The "augment" statement allows a module or submodule to add to the
>    schema tree defined in an external module, or the current module and
>    its submodules, and to add to the nodes from a grouping in a "uses"
>    statement.
> ‘
>  
> Versus online comments here: https://www.ietf.org/mail-archive/web/netmod/current/msg15418.html <https://www.ietf.org/mail-archive/web/netmod/current/msg15418.html>
>  
> ‘> On 01 Mar 2016, at 10:38, Anton Tkáčik <anton.tkacik at pantheon.tech> wrote:
> > 
> > Hi,
> > Noticed other issue with example set,
> > In https://github.com/mbj4668/pyang/issues/194 <https://github.com/mbj4668/pyang/issues/194> Lada stated that in YANG 1.0 submodule can not augment nodes
> > defined in parent model.
> > 
> > Is that correct that submodule can not augment definition defined in parent module?
>  
> This isn't possible in YANG 1.0 but will be possible in 1.1. However, in the present case the definition being augmented from the submodule is arguably in a different module.
>  
> Lada
> ‘
>  
> Thanks,
>  
> William
>  
>  
> _______________________________________________
> netmod mailing list
> netmod@ietf.org <mailto:netmod@ietf.org>
> https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>