On Mon, Jan 9, 2017 at 2:26 PM, Alex Campbell <[email protected]>
wrote:

> I don't see how a "when" statement modified by a deviation is any more
> complicated to implement than a "when" statement outside of a deviation -
> presuming that augments and deviations are processed before "when"
> statements.
>
>
>
augments and deviations are processed once when the module is loaded.
A when-stmt is processed anytime the value of the XPath boolean result
changes.


Alex
>
>
>
Andy


> ------------------------------
> *From:* Andy Bierman <[email protected]>
> *Sent:* Tuesday, 10 January 2017 11:20 a.m.
> *To:* Alex Campbell
> *Cc:* [email protected]
> *Subject:* Re: [netmod] "when" statement deviation
>
> Hi,
>
> This is not allowed because it is too complicated to implement.
> Changing the schema tree based on values of instances within the schema
> tree
> is full of complications.
>
> Note that when-stmt used where allowed enables or disables the schema tree
> without changing it. This is hard enough to support.
>
>
> Andy
>
>
> On Mon, Jan 9, 2017 at 1:56 PM, Alex Campbell <[email protected]>
> wrote:
>
>> Hi,
>>
>>
>> I have a module that adds some configuration to interfaces (the specific
>> feature being configured isn't important here, so I'll just call it
>> "feature").
>>
>> I want to implement this module, but the device I'm working on only
>> supports the feature on some kinds of interfaces.
>>
>> So I want to add a "when" constraint in a deviation module that says the
>> feature configuration is only available for these kinds of interfaces.
>>
>>
>> However, I found that "when" statements are not allowed to be affected by
>> deviations (according to the RFC and according to confdc).
>>
>> Is there a reason for this? It seems like an oversight.
>>
>>
>> Example:
>>
>>
>>     module feature-module {
>>
>>         // ... prefix, imports, etc ...
>>
>>         import ietf-interfaces {prefix if;}
>>
>>
>>         augment /if:interfaces/if:interface {
>>
>>             container feature {
>>
>>                 leaf enabled {
>>
>>                     type boolean;
>>
>>                     description "Enables the feature";
>>
>>                 }
>>
>>             }
>>
>>         }
>>
>>     }
>>
>>
>>     module feature-module-deviations {
>>
>>         // ... prefix, imports, etc ...
>>
>>         import feature-module {prefix fm;}
>>
>>         import iana-if-types {prefix ianaift;}
>>
>>
>>         deviation /if:interfaces/if:interface/fm:feature {
>>
>>             deviate add {
>>
>>                 // parsing fails here; "when" is not allowed as a child
>> of "deviate"
>>
>>                 when "../if:type = 'ianaift:ethernetCsmacd' or ../if:type
>> = 'ianaift:ieee8023adLag'";
>>
>>             }
>>
>>         }
>>
>>     }
>>
>>
>> Alex
>>
>>
>>
>> _______________________________________________
>> netmod mailing list
>> [email protected]
>> https://www.ietf.org/mailman/listinfo/netmod
>>
>>
>
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to