Re: [netmod] augment and if-feature

JOEY BOYD <joey.boyd@adtran.com> Tue, 14 March 2017 19:03 UTC

Return-Path: <joey.boyd@adtran.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 7F4DA129465 for <netmod@ietfa.amsl.com>; Tue, 14 Mar 2017 12:03:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.72
X-Spam-Level:
X-Spam-Status: No, score=-0.72 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] 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 93Gz0Fg5FWwG for <netmod@ietfa.amsl.com>; Tue, 14 Mar 2017 12:03:36 -0700 (PDT)
Received: from us-smtp-delivery-128.mimecast.com (us-smtp-delivery-128.mimecast.com [63.128.21.128]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 12EEB1288B8 for <netmod@ietf.org>; Tue, 14 Mar 2017 12:03:36 -0700 (PDT)
Received: from ex-hc3.corp.adtran.com (ex-hc2.adtran.com [76.164.174.82]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-20-Gse-FpWBPIOMpWZg0MXv6g-1; Tue, 14 Mar 2017 15:03:32 -0400
Received: from ex-mb1.corp.adtran.com ([fe80::51a3:972d:5f16:9952]) by ex-hc3.corp.adtran.com ([fe80::3892:20fa:600f:75c6%15]) with mapi id 14.03.0319.002; Tue, 14 Mar 2017 14:03:25 -0500
From: JOEY BOYD <joey.boyd@adtran.com>
To: 'Martin Bjorklund' <mbj@tail-f.com>
CC: "'netmod@ietf.org'" <netmod@ietf.org>
Thread-Topic: [netmod] augment and if-feature
Thread-Index: AdKczsxhgAE7MoK8QX+MSXhvQgcZPgARRd4AAAlB/MAAENhHwA==
Date: Tue, 14 Mar 2017 19:03:25 +0000
Message-ID: <26CE489EF4611643B3EFE43D06E02654015E659C82@ex-mb1.corp.adtran.com>
References: <26CE489EF4611643B3EFE43D06E02654015E6596C7@ex-mb1.corp.adtran.com> <20170314.183950.1234657423841109832.mbj@tail-f.com> <26CE489EF4611643B3EFE43D06E02654015E659C11@ex-mb1.corp.adtran.com>
In-Reply-To: <26CE489EF4611643B3EFE43D06E02654015E659C11@ex-mb1.corp.adtran.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [172.22.108.75]
MIME-Version: 1.0
X-MC-Unique: Gse-FpWBPIOMpWZg0MXv6g-1
Content-Type: text/plain; charset="WINDOWS-1252"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/pWzOEws8c4HmC0AgqTqd7VeLaSM>
Subject: Re: [netmod] augment and if-feature
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: Tue, 14 Mar 2017 19:03:44 -0000

Correcting the second augment below.

Joey

-----Original Message-----
From: JOEY BOYD 
Sent: Tuesday, March 14, 2017 1:21 PM
To: 'Martin Bjorklund'
Cc: netmod@ietf.org
Subject: RE: [netmod] augment and if-feature

What about this scenario?

module base-module {
  prefix bmod;

  feature things;
  feature widgets;

  container things {
    if-feature things;
    ...
    container widgets {
      if-feature widgets;
      ...
    }
  }
}    

module augment-module {
  prefix amod;

  augment "/bmod:things" {
    container other-things {
    }
  }

  augment "/bmod:things/bmod:widgets" {
    container other-widgets {
    }
  }
}

At some point, a product wants to implement the base-module and the augment-module but does not support 'widgets'. How should this be handled? I realize that ideally you would have an augment module for things and another for widgets but let's say that is not the case and you are left with the above. The question then is does the augment need to be conditional via the same feature or does it implicitly inherit the feature of the augmented node?

Regards,
Joey

-----Original Message-----
From: Martin Bjorklund [mailto:mbj@tail-f.com]
Sent: Tuesday, March 14, 2017 12:40 PM
To: JOEY BOYD
Cc: netmod@ietf.org
Subject: Re: [netmod] augment and if-feature

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