Hello,
In RFC6020bis we write:
"There MUST NOT be any circular dependencies in these "when" expressions."
How about a circular when-choice loop?
leaf a1 {
type boolean;
when not(../a2);
}
choice c2 {
default case2;
case case1 {
when not(a1);
leaf b1 {type int8;}
}
case case2 {
leaf a2 {
type boolean;
default true;
}
}
}
Initial state: a1=false, b1=5;
- Set a1=true
- case1 and b1 disapears
- case2 and a2=false are set as default
- a1 disappears
- if there is no a1 why did we delete case1/b1?
Did I miss something, is this really what happens?
Even if someone can come up with the correct solution, operators will be
100% sure to mess this up. Usability=0 !!!
I want some of this multistep when/when, choice/choice, when/choice
scenarios prohibited in RFC 6020 or 6087. Or state in 6020 that the
order of evaluation is implementation dependent: that would make it
unusable, so practically prohibiting then while maintaining backward
compatibility :-)
I attached an even more complicated example, so go ahead have fun
understand it!
regards Balazs
PS: Why did we make YANG so complicated?
--
Balazs Lengyel Ericsson Hungary Ltd.
Senior Specialist
ECN: 831 7320
Mobile: +36-70-330-7909 email: [email protected]
container scen22 { // When-1 (whenVariable1) becomes false,
// that removes a case-A (choice-scen22a:A),
// that creates case B/scen22-num2
// that makes when-2 false,
// that deletes a case branch,
// thus creating a sibling default case branch
presence yes;
leaf whenVariable1 { type boolean;}
choice choice-scen22a {
default B;
case A {
when whenVariable1; // when-1
leaf scen22-num1 {type int16;}
}
case B {
leaf scen22-num2 {type int16; default 5;}
}
}
leaf whenVariable { type boolean;}
choice choice-scen22b {
default B;
case A {
when "not(scen22-num2 = '5')"; // when-2
leaf scen22-num3 {type int16;}
}
case B {
leaf scen22-num4 {type int16; default 8;}
}
}
}
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod