> On 19 Nov 2015, at 11:11, Ladislav Lhotka <[email protected]> wrote:
> 
>> 
>> On 19 Nov 2015, at 10:38, Martin Bjorklund <[email protected]> wrote:
>> 
>> Andy Bierman <[email protected]> wrote:
>>> Hi,
>>> 
>>> This text in 7.21.5 is not clear:
>>> 
>>>  A leaf that is a list key MUST NOT have a "when" statement.
>>> 
>>> I think you mean that no when-stmt can use the key leaf as
>>> a context node.
>>> 
>>> These are illegal in YANG 1.1 I think:
>>> 
>>> 
>>>  augment /listX {
>>>     when "foo";
>>>     leaf key1 { ... }
>>>  }
>> 
>> Why would this be illegal?  You didn't show the definition of listX,
>> but it cannot have "key1" as one of its keys.
> 
> I think Andy has a point, here is a complete example:
> 
>  leaf foo {
>    type empty;
>  }
>  list array {
>    key "key1";
>    leaf bar {
>      type empty;
>    }
>  }
>  augment "/array" {
>    when "../foo";
>    leaf key1 {
>      type uint8;
>    }
>  }
> 
> Without the "when" statement it is perfectly okay but here the presence of 
> "foo" makes "key1" disappear but "array" remains.

s/presence/absence/ --------------------------------------------^^^^^^^^

Lada

> 
>> 
>>> OR
>>> 
>>> 
>>>   list listX {
>>>      key key1;
>>>      uses grouping1 {
>>>         when "foo";
>>>          // leaf key1 added via grouping
>>>      }
>>>   }
>> 
>> Why would this be illegal?
> 
> Similar as above.
> 
> Lada
> 
>> 
>>> There are more ways that the key-leaf can inherit a when-stmt
>>> but you get the idea.
>> 
>> I don't think a key leaf can "inherit" a when statement.
>> 
>>> The phrase "have a when-stmt" should be clear.
>>> It implies that the when-stmt is a sub-statement of the leaf-stmt
>>> but this is only 1 way the key leaf can be conditional.
>> 
>> 
>> 
>> /martin
>> 
>> _______________________________________________
>> netmod mailing list
>> [email protected]
>> https://www.ietf.org/mailman/listinfo/netmod
> 
> --
> Ladislav Lhotka, CZ.NIC Labs
> PGP Key ID: E74E8C0C
> 
> 
> 
> 
> _______________________________________________
> netmod mailing list
> [email protected]
> https://www.ietf.org/mailman/listinfo/netmod

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




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

Reply via email to