Re: [netmod] Y07: do not allow when or if-feature on key
Andy Bierman <andy@yumaworks.com> Fri, 02 January 2015 17:02 UTC
Return-Path: <andy@yumaworks.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B139D1A1B87 for <netmod@ietfa.amsl.com>; Fri, 2 Jan 2015 09:02:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.979
X-Spam-Level:
X-Spam-Status: No, score=-1.979 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham
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 qW3pXBgfxW6W for <netmod@ietfa.amsl.com>; Fri, 2 Jan 2015 09:02:43 -0800 (PST)
Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D2D0E1A1B81 for <netmod@ietf.org>; Fri, 2 Jan 2015 09:02:42 -0800 (PST)
Received: by mail-lb0-f177.google.com with SMTP id b6so14631945lbj.8 for <netmod@ietf.org>; Fri, 02 Jan 2015 09:02:41 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zoYjzSJL+KVV+CSVc3AY+lOjTHED3ftk9qRPczmZbk4=; b=OuArW5T+GlXwnOz2Ku6zkn+9WxCS6sx7WvKQM/QEF5gaYzT7HDIr48CTcOc1L06Y2O F+WrMPRnUtAnALNcYACGMsu+WXUkU/+F3jlaluR1bvcPjTLV6vs0HA2vFwMmDJb4R+Gk C3HtKZdge2WxSwk2NW3Xe+5ZuowtZfAkG+94ZZ6TssTJnIBEgZD5Nsi9iSpiDoyDAxMK YaGKkmR1xkGue8fj9sMofBMebzc9S5ttwR0L17ICi5QfM+/xI4OQOcOTdwH0m2SI+2Aj yQI04J+UHgGaVaoH66uM6Q/IIEYH5UCGQg8UwmAILjQX69XMFe63JbkfbohOE74G2MOd SDlA==
X-Gm-Message-State: ALoCoQmYaRWhC65dnKWCx5JI7zTxTM/rJZ/LhCEl4c7MwgipfaGz/wKM2eKE6mrUpaGi93tDxUAp
MIME-Version: 1.0
X-Received: by 10.112.156.132 with SMTP id we4mr52775963lbb.59.1420218161314; Fri, 02 Jan 2015 09:02:41 -0800 (PST)
Received: by 10.112.77.231 with HTTP; Fri, 2 Jan 2015 09:02:41 -0800 (PST)
In-Reply-To: <20150102.173921.2068884682648761059.mbj@tail-f.com>
References: <CABCOCHS-ci2XK8R5GsO3PycbFJiXPZCpF89Nvxz1DNujHC3ojw@mail.gmail.com> <76123ABE-5BB5-4358-8F12-84B81DB2C2F3@nic.cz> <CABCOCHTPQeiB4g2g+-YiGpMZLFxr+4tq5SdOvb3N=ne3jJsC0Q@mail.gmail.com> <20150102.173921.2068884682648761059.mbj@tail-f.com>
Date: Fri, 02 Jan 2015 09:02:41 -0800
Message-ID: <CABCOCHS=4_9QVf5wB8XPS5VEXJe9axUDMmrsZ2-tWKiTJmRmWQ@mail.gmail.com>
From: Andy Bierman <andy@yumaworks.com>
To: Martin Bjorklund <mbj@tail-f.com>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/netmod/FYavMIeD1v4BFq68TYwbd6ituRw
Cc: "netmod@ietf.org" <netmod@ietf.org>
Subject: Re: [netmod] Y07: do not allow when or if-feature on key
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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, 02 Jan 2015 17:02:44 -0000
On Fri, Jan 2, 2015 at 8:39 AM, Martin Bjorklund <mbj@tail-f.com> wrote:
> Andy Bierman <andy@yumaworks.com> wrote:
>> On Fri, Jan 2, 2015 at 6:52 AM, Ladislav Lhotka <lhotka@nic.cz> wrote:
>> >
>> >> On 02 Jan 2015, at 15:49, Andy Bierman <andy@yumaworks.com> wrote:
>> >>
>> >> Hi,
>> >>
>> >> This would make valid YANG 1.0 modules be rejected.
>> >> I strongly object to this change.
>> >
>> > No 1.0 module will be rejected if the statements are just ignored. It does mean a change in module semantics but then I guess this qualifies as a bug fix.
>> >
>>
>>
>> IMO it is a really bad idea to allow tools to ignore any statements
>> in the base language. This is only OK for external statements
>> defined with extensions.
>
> We already do this in a couple of instances; e.g. config statement in
> rpc/notification, and default in a key leaf.
>
And now we will change the rules in YANG 1.1 so default-stmt
is not ignored in a leaf? How is that backward-compatible?
>> It is really confusing to the writer and reader as well.
>>
>> I agree that it is not feasible for a tool to compare XPath statements
>> with different context nodes to see if they always produce the
>> same results. But it is easy to check if the feature-stmts are the same
>> or less than the parent.
>>
>> When-stmt can be inherited from uses and augment.
>> Not sure if keys can be augmented into a list, but uses can
>> certainly pull in the keys.
>
> [...]
>
>> Note that a when-stmt could appear in the uses-stmt or augment-stmts
>> making the key leaf conditional. Also, if-feature-stmts could be present
>> as well.
>>
>> I might be in favor of making key leafs that are conditional due to when-stmt
>> invalid and rejected with a compiler error. It's not OK to ignore this
>> condition.
>
> Consider this situation:
>
> grouping x {
> leaf a {
> if-feature "bar";
> type string;
> }
> }
>
> list y {
> key "a b";
> uses x;
> leaf b {
> type string;
> }
> }
>
> Now, if the server doesn't advertise "bar", what does this mean?
>
As I said before, it is an error for the leaf to have if-feature-stmts
that are not also in the parent node. Our compiler would flag leaf "a"
as an error.
If an "if-feature bar;" stmt appeared in the parent list y,
then this is not an error at all.
> YANG 1.0 doesn't say.
>
> We can make it illegal in 1.1, or we can say that the if-feature/when
> statements are ignored.
>
> If we make it illegal, it means that there is no way list y can use
> the grouping x.
>
sure it can -- add "if-feature bar;"
> I think Lada's suggestion was to ignore if-feature/when b/c of
> backwards compatibility reasons.
>
> This would be legal in 1.1, if we say that we ignore the if-feature:
>
> list y {
> if-feature "bar";
> key "a b";
> uses x;
> leaf b {
> type string;
> }
> }
>
>
This is legal now -- our tools support it and check for key leafs
that are more conditional than their parent. The statements are
validated
> /martin
Andy
- Re: [netmod] Y09: optional keys Phil Shafer
- [netmod] YANG 1.1 virtual interim 2014-11-19 Juergen Schoenwaelder
- Re: [netmod] YANG 1.1 virtual interim 2014-11-19 Phil Shafer
- [netmod] Y03: allow if-feature in refine (Was: YA… Martin Bjorklund
- [netmod] Y09: optional keys (Was: YANG 1.1 virtua… Martin Bjorklund
- [netmod] Y10: restrictions on enums (Was: YANG 1.… Martin Bjorklund
- [netmod] Y18: when context node (Was: YANG 1.1 vi… Martin Bjorklund
- [netmod] Y25: enum numbering (Was: YANG 1.1 virtu… Martin Bjorklund
- [netmod] Y26: mandatory nodes in augment (Was: YA… Martin Bjorklund
- [netmod] Y34: remove anyxml (Was: YANG 1.1 virtua… Martin Bjorklund
- [netmod] Y58: actions (Was: YANG 1.1 virtual inte… Martin Bjorklund
- [netmod] Y05: unprefixed paths in typedefs (Was: … Martin Bjorklund
- Re: [netmod] YANG 1.1 virtual interim 2014-11-19 Juergen Schoenwaelder
- Re: [netmod] Y03: allow if-feature in refine (Was… Phil Shafer
- Re: [netmod] Y34: remove anyxml (Was: YANG 1.1 vi… Phil Shafer
- Re: [netmod] Y26: mandatory nodes in augment (Was… Phil Shafer
- Re: [netmod] Y58: actions (Was: YANG 1.1 virtual … Phil Shafer
- Re: [netmod] Y34: remove anyxml Martin Bjorklund
- Re: [netmod] Y34: remove anyxml Martin Bjorklund
- Re: [netmod] Y26: mandatory nodes in augment Martin Bjorklund
- Re: [netmod] Y34: remove anyxml Ladislav Lhotka
- Re: [netmod] Y34: remove anyxml Kent Watsen
- Re: [netmod] Y34: remove anyxml Martin Bjorklund
- Re: [netmod] Y34: remove anyxml Andy Bierman
- Re: [netmod] Y34: remove anyxml Phil Shafer
- Re: [netmod] Y34: remove anyxml Martin Bjorklund
- Re: [netmod] Y34: remove anyxml Andy Bierman
- Re: [netmod] Y34: remove anyxml Phil Shafer
- Re: [netmod] Y34: remove anyxml Ladislav Lhotka
- Re: [netmod] Y34: remove anyxml Ladislav Lhotka
- Re: [netmod] Y09: optional keys (Was: YANG 1.1 vi… Ladislav Lhotka
- Re: [netmod] Y34: remove anyxml Martin Bjorklund
- Re: [netmod] Y09: optional keys Martin Bjorklund
- Re: [netmod] Y34: remove anyxml Ladislav Lhotka
- Re: [netmod] Y09: optional keys Ladislav Lhotka
- Re: [netmod] Y26: mandatory nodes in augment Ladislav Lhotka
- Re: [netmod] Y09: optional keys Martin Bjorklund
- Re: [netmod] Y09: optional keys Ladislav Lhotka
- Re: [netmod] Y09: optional keys Martin Bjorklund
- Re: [netmod] Y09: optional keys Ladislav Lhotka
- Re: [netmod] Y34: remove anyxml Kent Watsen
- Re: [netmod] Y34: remove anyxml Kent Watsen
- Re: [netmod] Y34: remove anyxml Ladislav Lhotka
- Re: [netmod] Y09: optional keys Andy Bierman
- Re: [netmod] Y09: optional keys Martin Bjorklund
- Re: [netmod] Y09: optional keys Ladislav Lhotka
- Re: [netmod] Y09: optional keys Andy Bierman
- Re: [netmod] Y26: mandatory nodes in augment Andy Bierman
- Re: [netmod] Y26: mandatory nodes in augment Ladislav Lhotka
- Re: [netmod] Y26: mandatory nodes in augment Andy Bierman
- Re: [netmod] Y26: mandatory nodes in augment Ladislav Lhotka
- Re: [netmod] Y26: mandatory nodes in augment Andy Bierman
- [netmod] Y07: do not allow when or if-feature on … Martin Bjorklund
- Re: [netmod] Y07: do not allow when or if-feature… Ladislav Lhotka
- Re: [netmod] Y07: do not allow when or if-feature… Martin Bjorklund
- Re: [netmod] Y07: do not allow when or if-feature… Andy Bierman
- Re: [netmod] Y07: do not allow when or if-feature… Ladislav Lhotka
- Re: [netmod] Y07: do not allow when or if-feature… Andy Bierman
- Re: [netmod] Y07: do not allow when or if-feature… Martin Bjorklund
- Re: [netmod] Y07: do not allow when or if-feature… Andy Bierman
- Re: [netmod] Y07: do not allow when or if-feature… Martin Bjorklund
- Re: [netmod] Y07: do not allow when or if-feature… Ladislav Lhotka
- Re: [netmod] Y07: do not allow when or if-feature… Andy Bierman
- Re: [netmod] Y07: do not allow when or if-feature… Ladislav Lhotka
- Re: [netmod] Y07: do not allow when or if-feature… Andy Bierman
- Re: [netmod] Y07: do not allow when or if-feature… Ladislav Lhotka
- Re: [netmod] Y07: do not allow when or if-feature… Juergen Schoenwaelder