Subject: [netmod] if-feature on key leafs

From: Balazs Lengyel <[email-masked]>
Date: Fri, 24 Apr 2015 13:19:35 +0200

Hello,
While reviewing the YANG 1.1 draft I found the following:
"   A leaf that is a list key MUST NOT have any "if-feature" statements,
    unless the conditions specified in the "if-feature" statements are
    the same as the "if-feature" conditions in effect on the leaf's
    parent node."

I simply fail to understand for what reason do we allow if-feature on
key leafs. The leaf will be present or not following the same rules as
its parent list. So if you have or don't have the if-feature on the
leaf, the effect is exactly the same. Then why complicate things by
allowing it on the leaf?

I propose to simply state:
A leaf that is a list key MUST NOT have any "if-feature" statements.

regards Balazs

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
Senior Specialist
ECN: 831 7320
Mobile: +36-70-330-7909              email: [email-masked]

---

From: Ladislav Lhotka <[email-masked]>
Date: Fri, 24 Apr 2015 13:42:34 +0200

> On 24 Apr 2015, at 13:19, Balazs Lengyel <[email-masked]> wrote:
> 
> Hello,

The only use case is when the key leaf is in a grouping and contains the if-feature statement there.

Lada 

> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C

---

From: Balázs Lengyel <[email-masked]>
Date: Fri, 24 Apr 2015 11:50:46 +0000

Even in a grouping case you still need to put the exact same if-feature on the list. SO what do you gain?
Balazs

-----Original Message-----
From: Ladislav Lhotka [mailto:[email-masked]] 
Sent: Friday, 24 April, 2015 13:43
To: Balázs Lengyel
Cc: [email-masked]
Subject: Re: [netmod] if-feature on key leafs

Lada

---

From: Ladislav Lhotka <[email-masked]>
Date: Fri, 24 Apr 2015 14:03:12 +0200

> On 24 Apr 2015, at 13:50, Balázs Lengyel <[email-masked]> wrote:
> 

You may want to use the same grouping elsewhere (not in a list) and then the if-feature may come into play.

That said, I supported Y07-03, so I am not the right person to defend Y07-01. In any case, making
if-feature on keys illegal could possibly make some YANG 1.0 modules invalid, which is against the charter.

Lada

---

From: Balázs Lengyel <[email-masked]>
Date: Fri, 24 Apr 2015 12:36:06 +0000

We are anyway restricting if-feature on key leafs compared to YANG 1.0 so we are already backwards incompatible. However in this case this is more of a bugfix then a true incompatibility.
IMHO the grouping use case is really-really a corner case.

Regards Balazs

-----Original Message-----
From: Ladislav Lhotka [mailto:[email-masked]] 
Sent: Friday, 24 April, 2015 14:03
To: Balázs Lengyel
Cc: [email-masked]
Subject: Re: [netmod] if-feature on key leafs

That said, I supported Y07-03, so I am not the right person to defend Y07-01. In any case, making if-feature on keys illegal could possibly make some YANG 1.0 modules invalid, which is against the charter.

Lada 

>> key leafs. The leaf will be present or not following the same rules 
>> as its parent list. So if you have or don't have the if-feature on 
>> the leaf, the effect is exactly the same. Then why complicate things 
>> by allowing it on the leaf?
>

---

From: Ladislav Lhotka <[email-masked]>
Date: Fri, 24 Apr 2015 14:37:58 +0200

> On 24 Apr 2015, at 14:36, Balázs Lengyel <[email-masked]> wrote:
> 

I fully agree with you. :-)

Lada

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Fri, 24 Apr 2015 14:46:08 +0200

On Fri, Apr 24, 2015 at 12:36:06PM +0000, Balázs Lengyel wrote:

> We are anyway restricting if-feature on key leafs compared to YANG
> 1.0 so we are already backwards incompatible. However in this case
> this is more of a bugfix then a true incompatibility.  IMHO the
> grouping use case is really-really a corner case.

Perhaps this is not terribly useful but then there are a number of
things that are legal and perhaps not terribly useful. It can be
dangerous to rule out stuff because of 'who would ever do it' and then
later someone has to do extra work to ensure that if-feature
definitions are not repeated, e.g., when translating from other models
into YANG. Since it was not considered broken to repeat stuff, I would
rather not touch this.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>