Hello,
What do the mandatory statements mean in the following model ?
choice scen8 { // Embedded choices with multiple mandatory
cases; invalid scenario
case A {
choice subChoiceA {
mandatory true;
case A {
leaf scen8-num1 { type uint8; }
}
case B {
leaf scen8-num2 { type uint8; }
}
}
}
case B {
choice subChoiceB {
mandatory true;
case A {
leaf scen8-num1 { type uint8; }
}
case B {
leaf scen8-num2 { type uint8; }
}
}
}
}
Answers:
A1) They mean nothing because the case around subChoiceA/B might not
exist, in which case its underlying statements are not valid.
A2) They mean that one case from both subChoiceA AND subchoiceB must
exist leading to two cases in choice scen8 which is not allowed, hence
this is an invalid model?
Generally I find choices embedded in choices to be so complicated that
IMHO they SHOULD be immediately prohibited. If you think about all the
variants of embedded choices with mandatory and default placed on some
or a bunch of them, even understanding what they mean becomes a
headache. BAD !!!! In the beginning YANG was about easy-understanding.
However these combinations are unclear even after repeatedly reading the
RFC :-(
As the very least we SHOULD prohibit mandatory/default on the inside
choice.
regards Balazs
--
Balazs Lengyel Ericsson Hungary Ltd.
Senior Specialist
ECN: 831 7320
Mobile: +36-70-330-7909 email: [email protected]
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod