Hi all,

I saw some recent questions about 'when' statements. I had another one related 
to evaluating 'when' statements that involve leafs that don't currently have a 
value at all.

leaf foo {
    type enumeration {
        enum val1;
        enum val2;
    }
}

leaf bar {
    when "../foo != 'val2'";
    type uint8;
}

Notice that foo does not have a default statement. So if no manager has set 
leaf foo, it doesn't exist in the config.

In that case, does the "when" statement evaluate to 'true'  (i.e. leaf bar is 
allowed to have a value) ?

i.e. assuming leaf foo is not set at all, is this accepted?
<bar>23</bar>

Or is there something special here because of the non-existence of leaf foo?

If the "when" evaluates to 'false', then does the following "when" evaluate 
differently than the one above?
    when "not(../foo = 'val2')";

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

Reply via email to