Re: [netmod] augment and if-feature

Robert Wilton <rwilton@cisco.com> Fri, 17 March 2017 14:41 UTC

Return-Path: <rwilton@cisco.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 24DD11293DF for <netmod@ietfa.amsl.com>; Fri, 17 Mar 2017 07:41:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.522
X-Spam-Level:
X-Spam-Status: No, score=-14.522 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 ZUrtgSUKLbCG for <netmod@ietfa.amsl.com>; Fri, 17 Mar 2017 07:41:00 -0700 (PDT)
Received: from aer-iport-4.cisco.com (aer-iport-4.cisco.com [173.38.203.54]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7BAC2129457 for <netmod@ietf.org>; Fri, 17 Mar 2017 07:40:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2697; q=dns/txt; s=iport; t=1489761659; x=1490971259; h=subject:to:references:cc:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=cGLhoe64Wa5Q2Qpb2V/amHhOGBDMygVmHP8PU7rb7Wg=; b=M5eL6pxX5jT6z9NpLXu2OKVF1SAiLINFbhtfr+cY1+cBsn/X3CVwLpO9 FH02bIQq4E82azG05cogkPvADZTTkpj16xO+OYdUD9G0hpXQwj3WV+v4E vwf4nn6c4KYtC5p3Rt+3kA6EA7+JGhfz8opbitbYwLqoo8VztDzS1EEcB g=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0AHAgCs9MtY/xbLJq1eGgEBAQECAQEBAQgBAQEBgyeBNQdZjXFzkGWVQoIOgmyDNgKDPhgBAgEBAQEBAQFrKIUVAQEBAQIBOEEQCxguVwYNBgIBAYl0CLQ5ik8BAQEBAQEBAQEBAQEBAQEBASGGToIFgmqKOQEEnEmSQopWhlWLQogRHziBBCMWCBcVhxhANYlXAQEB
X-IronPort-AV: E=Sophos;i="5.36,177,1486425600"; d="scan'208";a="653340102"
Received: from aer-iport-nat.cisco.com (HELO aer-core-3.cisco.com) ([173.38.203.22]) by aer-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Mar 2017 14:40:57 +0000
Received: from [10.63.23.115] (dhcp-ensft1-uk-vla370-10-63-23-115.cisco.com [10.63.23.115]) by aer-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id v2HEeueq029343; Fri, 17 Mar 2017 14:40:57 GMT
To: "Dale R. Worley" <worley@ariadne.com>
References: <87pohgova5.fsf@hobgoblin.ariadne.com>
Cc: andy@yumaworks.com, joey.boyd@adtran.com, netmod@ietf.org
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <3006056f-0b0e-1cab-e402-a1251ee77e7e@cisco.com>
Date: Fri, 17 Mar 2017 14:40:55 +0000
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
MIME-Version: 1.0
In-Reply-To: <87pohgova5.fsf@hobgoblin.ariadne.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/REgkBWLs5huWHzfQWW9VxJIWovg>
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: Fri, 17 Mar 2017 14:41:02 -0000


On 17/03/2017 14:03, Dale R. Worley wrote:
> Robert Wilton <rwilton@cisco.com> writes:
>> 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?
>>
>> 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 {
>>       }
>>     }
>> }
> Does it remain valid if base-module is changed to:
>
>      module base-module {
>         prefix bmod;
>
>         feature things;
>         feature widgets;
>
>         container things {
>           if-feature things;
>           ...
>           }
>         }
>      }
No, I don't think that it is valid because this augment fails because 
the base node "/bmod:things/bmod:widgets" doesn't exist.

>
> As I analyze it, the augment statement is unconditional, but the
> presence of its target node can be (1) unconditional, (2) conditional,
> or (3) *never* present.
>
> My preferred approach is that an augment is only valid if it is
> "present" only if the target node is present (a condition I think can be
> verified statically).  But if we allow the augment to silently have no
> effect if the target node is not present in the current implementation,
> do we still require that there is some possible implementation in which
> the target node exists?
I guess that I think that a node with an if-feature stmt is logically 
present in the schema (and hence can always be augmented), but just that 
it (and its descendant nodes) can be supported/unsupported depending on 
what features a device advertises that it is supporting.

But I don't think that means that an augmentation is ever is ignored, 
but it might add nodes to the schema tree that aren't supported because 
a given feature isn't supported.

Phil's example of a feature that relates to whether an SD card is 
present is interesting because it gives an example of when it might be 
useful to dynamically modify the set of supported features whilst a 
device is running.  Likewise, I could see how the features could change 
due to adding/removing software components, or different revisions of 
hardware.

Thanks,
Rob

>
> Dale
> .
>