Re: [netmod] augment and if-feature

Andy Bierman <andy@yumaworks.com> Thu, 16 March 2017 17:26 UTC

Return-Path: <andy@yumaworks.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 E5A981296C8 for <netmod@ietfa.amsl.com>; Thu, 16 Mar 2017 10:26:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
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 jEHTuwa1cZRq for <netmod@ietfa.amsl.com>; Thu, 16 Mar 2017 10:26:11 -0700 (PDT)
Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 09A461296DC for <netmod@ietf.org>; Thu, 16 Mar 2017 10:26:11 -0700 (PDT)
Received: by mail-wm0-x231.google.com with SMTP id t189so53861470wmt.1 for <netmod@ietf.org>; Thu, 16 Mar 2017 10:26:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NhuMELW2ze61ziml8taK/bLgihEj9lwZY38IF4drdfM=; b=cbGtfxemuekC8cO5caPZXs3ZDan4IDk1987cMXJ4CJtO458waUyDZ6C6oQDWyvmyB8 CWJNuj83pQ/0E8WyPiWcK33rih6xp/r9LUrkJznncv2eX/Dv6fyoAsVoBZcaC/PhTosX oJ/t0cwTfS7QUZNh/yFl6wLlZg5kN5qmyNuFteCng81ofjGoXVpekCsJ3SdN95ByRJ6W 5I4IjWor103tGAXJDgfzpRzJKVFxecRAJ+2GaC0RqAG0PeWchp0gOv4ZMQXsiECMA4rp /Z+0S3XXh/sYhoebYYfIEOPaCeRHThszpix3TpoAJKo2lsa9OEiHc/0CLbDAPiCfl0Zl 23pg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NhuMELW2ze61ziml8taK/bLgihEj9lwZY38IF4drdfM=; b=J5i0iCYoUjh5jv+pDzIjLF6rRtJQ22J6e5Xw7PdtPcV1FvX/hB/u3VUBKR2U+QxmdC vbwekQyXdVWUQMJqMIMKMYCamfgeJOva95Wfnu9DdIvetuLTtj0xzepLAd3//7ptGdBI ApEPBgtvwIvi/di1Ig18EHntlo/SnEZ6XC3xgqS1t1909/MJOAP2bV3aYyHqhGvy2LAK hR4IRawe+G2VhVCiNi51FM/7O408r0oR2FamoFsySCGJ5Rk+oxBeZZDMlJBR659tKE+m 0sdASTtwiEygl2vfE897NXP5EqJ71U+pvY0TR7hqhy7dLK9gNRFBdERyCXjwPWS07iFY 54UQ==
X-Gm-Message-State: AFeK/H0oUhBoU9uPjfFltzT1DlfoD5fFPm5BJnrKAcslI4WC0BFBn7WdBNMPbP5Xmd93GloA1ufpv5CzGdUWmg==
X-Received: by 10.28.103.3 with SMTP id b3mr24018494wmc.99.1489685169561; Thu, 16 Mar 2017 10:26:09 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.166.37 with HTTP; Thu, 16 Mar 2017 10:26:08 -0700 (PDT)
In-Reply-To: <67e7ba2b-c526-fd9b-f39f-14f5b0490f4f@cisco.com>
References: <877f3q2wje.fsf@hobgoblin.ariadne.com> <ef923b5e-8557-c6d3-8b10-e103cf8d38de@cisco.com> <CABCOCHQkps=1Do1bXPF-hRk=YpG-d8p+xoDBE4=_evgoZQ7u-w@mail.gmail.com> <67e7ba2b-c526-fd9b-f39f-14f5b0490f4f@cisco.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Thu, 16 Mar 2017 10:26:08 -0700
Message-ID: <CABCOCHQ=Yrde0COtFbCiYj4w3e0d7DY56tqrhaBmVWZvsK3ywg@mail.gmail.com>
To: Robert Wilton <rwilton@cisco.com>
Cc: "Dale R. Worley" <worley@ariadne.com>, JOEY BOYD <joey.boyd@adtran.com>, "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="001a114a91b25c0a6d054adc5b10"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/3ugPMTtGj22pZ58pM9tDi2EOXms>
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: Thu, 16 Mar 2017 17:26:14 -0000

On Thu, Mar 16, 2017 at 10:18 AM, Robert Wilton <rwilton@cisco.com> wrote:

> Hi Andy,
>
> On 16/03/2017 16:17, Andy Bierman wrote:
>
>
>
> On Thu, Mar 16, 2017 at 2:54 AM, Robert Wilton <rwilton@cisco.com> wrote:
>
>> Hi Dale,
>>
>>
>> On 15/03/2017 19:02, Dale R. Worley wrote:
>>
>>> JOEY BOYD <joey.boyd@adtran.com> writes:
>>>
>>>> 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 {
>>>>      }
>>>>    }
>>>> }
>>>>
>>> First question:  I'm not expert in Yang, but as far as I can figure out,
>>> the augment statement is augmenting "container things", right?  So the
>>> augment statement should be 'augment "/bmod:things"' not 'augment
>>> "/bmod:do-things"'.
>>>
>> Yes, the augment should be to "things".
>>
>>
>>> But on the important question, I don't see it as at all unreasonable
>>> that the augment needs to be qualified by the same if-feature.  The
>>> reason is that if you're reading the text of module augment-module, it's
>>> helpful to have documented, right there, that the augmentation depends
>>> on the presence of a particular feature in the augmented module.  And
>>> it's helpful to know that the designer did, at least for one moment,
>>> think about the fact that the augmentation is conditional.
>>>
>>
>> It isn't just any if-feature on the container that is being augmented
>> that needs to be considered.  You would have to consider all if-feature
>> statements by walking up the augmented node's ancestors to the top of the
>> tree and combine them, or have multiple if-feature statements.
>>
>> Further, the 7950 YANG update rules allow for the augmented module to be
>> revised and some of those if-feature statements to be subsequently
>> removed.  If the augmenting module had restated the if-feature conditions
>> then this would probably leave the augmenting module unintentionally out of
>> sync with the module that it is augmenting.
>>
>> In short, I think that if-feature statements work better if they act on
>> the given node and all descendant nodes, regardless of which module those
>> descendants are defined in.
>>
>>
> "work better"
>
> Please explain which protocol you are using that allows you to manage
> descendant nodes of unimplemented nodes.
>
> NETCONF and RESTCONF do not work at all wrt/ accessing such nodes.
>
> I think that we may be crossing wires:
>
> It was NETCONF/RESTCONF that I was thinking of, and I am not considering
> managing descendant nodes of unimplemented nodes.
>
> I think that the question is only whether an augmentation of a node that
> has an if-feature statement also requires the same if-feature statement on
> the augment statement.
>
>
no -- I don't think there is any requirement.
As pointed out, the if-features can be anywhere in the ancestor nodes.
If any of them are false for a given server, then the augmenting nodes are
inaccessible.


To quote Joey's example,  I think that both of the following modules are
> valid (presuming that they are both implemented by a device) regardless of
> which features are enabled.  Do you agree?
>
>

The modules are valid.
The conformance decision (i.e., which features are advertised and which are
not by a server implementation)
does not change the compile-time validity of the YANG modules


> 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 {
>     }
>   }
> }
>
> Thanks,
> Rob
>
>
>

Andy


>
>
>> Rob
>>
>>
> Andy
>
>
>>
>>
>>> Dale
>>>
>>> _______________________________________________
>>> netmod mailing list
>>> netmod@ietf.org
>>> https://www.ietf.org/mailman/listinfo/netmod
>>> .
>>>
>>>
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod
>>
>
>
>