public
public copied to clipboard
`deprecated` statement under `uses` statement
It seems that when deprecating uses
statement in order to restructure the model, the pyang output is not able to represent this at all. This causes restructuring of groupings to be much harder to notice, especially when trying to maintain backwards compatibility. The output of pyang would contain all of the paths and nothing will be indicated as deprecated (x--rw <node>
vs +--rw <node>
)
Doing a bit of research, the pyang devs interpreted the RFC for deprecated to not be recursively applied for containers (See https://github.com/mbj4668/pyang/issues/577). Looking at both RFC6020 and RFC7950 there isn't a defined behavior for the uses
statement.
What would be the guidance for OpenConfig wrt. adding status deprecated;
to uses
statements?
The PR #1105 is one of such changes that are affected by this.
For example:
grouping foo-config {
leaf a {
type uint32;
}
leaf b {
type string;
}
}
grouping foo {
container config {
uses foo-config;
}
container state {
uses foo-config;
}
}
grouping top {
container new {
uses foo;
}
container old {
uses foo {
status deprecated;
}
}
}
uses top;
module: openconfig-test
+--rw new
| +--rw config
| | +--rw a? uint32
| | +--rw b? string
| +--rw state
| +--rw a? uint32
| +--rw b? string
+--rw old
+--rw config
| +--rw a? uint32
| +--rw b? string
+--rw state
+--rw a? uint32
+--rw b? string