[YANGTOOLS-1063] Make DataSchemaNode.isConfiguration() tri-state Created: 08/Jan/20 Updated: 04/Dec/20 Resolved: 04/Dec/20 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | parser |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0 |
| Type: | Improvement | Priority: | High |
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
The idea that isConfiguration() boils down to a simple boolean is flawed, as DataSchemaNodes defined under a grouping can be either. There are three basic models here:
module foo {
grouping foo {
container indeterminate {
// ancestors is neither true or false, hence we do not know
}
}
container cfg {
// No config, defaults to true
grouping foo {
container indeterminate {
// ancestor is config=true, but this may be used in config=false
}
}
}
container oper {
// Explicitly false
config false;
grouping foo {
container false {
// ancestor is config=false and hence this can only be referenced
// by other config=false nodes.
}
}
}
}
For the purposes of modeling, though, DataSchemaNodes defined within a grouping hierarchy should have a isConfiguration=UNDEF. Semantically the question is what happens to nodes in notifications/actions/RPCs – they are not inherently tied to a particular data store, although RFC7950 would seem to imply these are runtime constructs and hence would be config=false. Since ODL extends the invocation model to allow RPC/action/notifications on any datastore, these should end up being undefined, too.
|
| Comments |
| Comment by Robert Varga [ 17/Apr/20 ] |
|
We probably want to have a separate boolean property which rolls up whether the boolean returned by isConfiguration() is accurate, i.e. whether the node is in fact instantiated. That way we can ignore guidance from config statement for the purposes where this matters. |