Re: [netmod] removing a node from a grouping

Per Hedeland <per@tail-f.com> Mon, 16 July 2018 06:31 UTC

Return-Path: <per@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 325F2130F53 for <netmod@ietfa.amsl.com>; Sun, 15 Jul 2018 23:31:46 -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, SPF_PASS=-0.001, URIBL_BLOCKED=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 b1Gy7USeq_72 for <netmod@ietfa.amsl.com>; Sun, 15 Jul 2018 23:31:43 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id B18F312E039 for <netmod@ietf.org>; Sun, 15 Jul 2018 23:31:43 -0700 (PDT)
Received: from pluto.hedeland.org (81-228-153-183-no289.tbcn.telia.com [81.228.153.183]) by mail.tail-f.com (Postfix) with ESMTPSA id DDB6D1AE02AC; Mon, 16 Jul 2018 08:31:40 +0200 (CEST)
To: Robert Wilton <rwilton=40cisco.com@dmarc.ietf.org>
References: <C16EE3E0-D7B6-486F-8224-F1CC7B224A1D@juniper.net> <80f2c076-1937-9b09-fdec-a4d4c9a16aa5@cisco.com> <B1FEB2BF-5F35-47D0-AE79-517136728071@juniper.net> <f0a98a7b-bf46-8bd1-0483-d9dbd410cc93@cisco.com>
From: Per Hedeland <per@tail-f.com>
Cc: Kent Watsen <kwatsen@juniper.net>, "netmod@ietf.org" <netmod@ietf.org>
Message-ID: <8995a833-21cb-8126-5a40-2972ba1a4e1a@tail-f.com>
Date: Mon, 16 Jul 2018 08:31:40 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <f0a98a7b-bf46-8bd1-0483-d9dbd410cc93@cisco.com>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/RGPrd8vhxR1VzyaZPN7jpuhN2s4>
Subject: Re: [netmod] removing a node from a grouping
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.27
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, 16 Jul 2018 06:31:46 -0000

On 2018-07-15 13:11, Robert Wilton wrote:
> Hi Kent,
> 
> I don't think that this is a valid use of augment - I thought that augment can only add news data nodes, not add extra sub statements to existing ones.

Well, it is valid (though not if "foo" is a leaf), but you are right,
and it doesn't do what Kent expects. The 'when' statement, as always,
"makes its parent data definition statement conditional". I.e. it
applies to the 'augment' statement, not the 'foo' statement, and thus
with an always-false 'when', no 'augment' will happen.

--Per

> Also, YANG allows grouping to be changed so that it is constructed from sub groupings, at long as the original grouping name is preserved and is only updated in a backwards compatible way.  But as you 
> say, this can still lead to unnatural groupings.
> 
> I still think that groupings are probably being overused.  Perhaps Andy's clone statement might be a better alternative in some cases (https://github.com/netmod-wg/yang-next/issues/31).
> 
> Thanks,
> Rob
> 
> 
> On 14/07/2018 18:46, Kent Watsen wrote:
>> Hi Rob,
>>
>> Right you are, "refine" doesn't have a "when" substatement, but "augment" does.
>>
>>      grouping "bar-etc" {
>>        uses "foo-bar-etc" {
>>          augment "foo" {
>>            when "false()";
>>          }
>>        }
>>      }
>>
>>
>> The problem with splitting up groupings is that 1) it needs to be done
>> beforehand and 2) it may produce "unnatural" groupings that wouldn't be
>> there otherwise.
>>
>> Kent
>>
>>
>> ===== original message =====
>>
>> Hi Kent,
>>
>> I'm not sure that sec 7.13.2 of 7950 allows refine to add a when
>> statement, although an equivalent solution would be refine it with an
>> if-feature statement for a feature that is never enabled.
>>
>> Ideally, I think that the groupings would be split up, so that they
>> build on each other.
>>
>>     grouping "foo" {
>>       container-or-leaf "foo" { ... }
>>     }
>>
>>     grouping "bar-etc" {
>>       container-or-leaf "bar" { ... }
>>       ...  // the "etc" ;)
>>     }
>>
>>     grouping "foo-bar-etc" {
>>       grouping "foo";
>>       grouping "bar-etc";
>>     }
>>
>> Thanks,
>> Rob
>>
>> On 11/07/2018 18:30, Kent Watsen wrote:
>>> Say there is:
>>>
>>>     grouping "foo-bar-etc" {
>>>       container-or-leaf "foo" { ... }
>>>       container-or-leaf "bar" { ... }
>>>       ...  // the "etc" ;)
>>>     }
>>>
>>> And the goal is to use the grouping sans the "foo" node.
>>> Can a "when" statement that always evaluates to "false"
>>> do it?
>>>
>>>     grouping "bar-etc" {
>>>       uses "foo-bar-etc" {
>>>         refine "foo" {
>>>           when "false()";
>>>         }
>>>       }
>>>     }
>>>
>>> Any better ideas?
>>>
>>> Thanks,
>>> Kent
>>>
>>>
>>>
>>> _______________________________________________
>>> netmod mailing list
>>> netmod@ietf.org
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_netmod&d=DwIDaQ&c=HAkYuh63rsuhr6Scbfh0UjBXeMK-ndb3voDTXcWzoCI&r=9zkP0xnJUvZGJ9EPoOH7Yhqn2gsBYaGTvjISlaJdcZo&m=n8AUR8gtF330d96dqckvx53hCdyUm5tsTzJsm6DU83U&s=hD50p0RzLVzzTnQ62nxgs256wFf7UmIczTJMf9ym_n8&e= 
>>>
>>> .
>>>
>>
>>
> 
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod