(Originally posted to the netconf mailing list in error. My apologies.)
Hello,
When a node defaults to config true and a deviation changes it to config false,
should "deviate add" or "deviate replace" be used? Some YANG implementations
allow either, some allow only "deviate replace". Perhaps some allow only
"deviate add" but we have not yet seen that.
Consider these definitions:
container x {
leaf y {
type string;
}
}
deviation /x/y {
deviate replace { <-- Should this be add or replace?
config false;
}
}
Section 7.18.3.2 of RFC 6020 says:
The argument "add" adds properties to the target node. The
properties to add are identified by substatements to the "deviate"
statement. If a property can only appear once, the property MUST NOT
exist in the target node.
The argument "replace" replaces properties of the target node. The
properties to replace are identified by substatements to the
"deviate" statement. The properties to replace MUST exist in the
target node.
/x/y is config true by default even though config is not explictly given.
Section 7.19.1 of RFC 6020 is not clear about whether config is considered to
exist when defaulted.
If config is considered to exist, then "deviate replace" is correct. Otherwise,
"deviate add" is correct. Technically, RFC 6020 allows only one or the other
but not both in this case, but perhaps a robust implementation should accept
both.
YANG file authors need to pick one or the other, so clear guidance would be
helpful.
Thanks,
Gustav
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod