Re: [netmod] augment and if-feature

Martin Bjorklund <mbj@tail-f.com> Tue, 14 March 2017 17:39 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 29CF1129892 for <netmod@ietfa.amsl.com>; Tue, 14 Mar 2017 10:39:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-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 aUkOO_EyV-4W for <netmod@ietfa.amsl.com>; Tue, 14 Mar 2017 10:39:53 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 07F93129499 for <netmod@ietf.org>; Tue, 14 Mar 2017 10:39:52 -0700 (PDT)
Received: from localhost (h-148-188.a165.priv.bahnhof.se [176.10.148.188]) by mail.tail-f.com (Postfix) with ESMTPSA id 007711AE018C; Tue, 14 Mar 2017 18:39:50 +0100 (CET)
Date: Tue, 14 Mar 2017 18:39:50 +0100
Message-Id: <20170314.183950.1234657423841109832.mbj@tail-f.com>
To: joey.boyd@adtran.com
Cc: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <26CE489EF4611643B3EFE43D06E02654015E6596C7@ex-mb1.corp.adtran.com>
References: <26CE489EF4611643B3EFE43D06E02654015E6596C7@ex-mb1.corp.adtran.com>
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/Ziq4JZySi8cEdw93HDE65PRQPX8>
Subject: Re: [netmod] augment and if-feature
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.21
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, 14 Mar 2017 17:39:54 -0000

Hi,

JOEY BOYD <joey.boyd@adtran.com> wrote:
> Hi all,
> 
> An issue arose recently where a certain tool failed to build the
> schema tree when a feature was turned off. The problem was that an
> augmenting module did not have the same if-feature statement as the
> node being augmented. For example, I have these two modules.
> 
> module base-module {
>   prefix bmod;
> 
>   feature do-things;
> 
>   container things {
>     if-feature do-things;
>     ...
>   }
> }
> 
> module augment-module {
>   prefix amod;
> 
>   augment "/bmod:do-things" {
>     container other-things {
>     }
>   }
> }
> 
> If I included both modules and turned off the feature, 'do-things',
> the tool would complain that the node being augmented did not
> exist. Forgetting the obvious solution of not including the augmenting
> module if you don't support the feature (this is a very simplified
> example), my thought was that the schema tree should first be built
> including all augments, then the feature is applied.
> 
> What are your thoughts on this? Surely, an augment should not have to
> contain if-feature statements of all parents of the augmented node.

The spec says:

   When a server implements a module containing an "augment" statement,
   that implies that the server's implementation of the augmented module
   contains the additional nodes.

Compare with a simple augment of a node w/o an if-feature.  In this
case, if the server implements the augmenting module, it MUST also
implement the augmented module.



/martin