Age | Commit message (Collapse) | Author |
|
|
|
process_node() processes the XML tree in a fixed order, "node" before "tagNode"
before "leafNode". If the generator created a "node.def" file, it can no longer
be overwritten - else we would have some stale "node.def" files with an empty
help string (T2555). Without the fixed order this would resulted in a case
where we get a node and a tagNode with the same name, e.g. "show interfaces
ethernet" and "show interfaces ethernet eth0" that the node implementation
was not callable from the CLI, rendering this command useless (T3807).
This can be fixed by forcing the "node", "tagNode", "leafNode" order by sorting
the input XML file automatically (sorting from https://stackoverflow.com/a/46128043)
thus adding no additional overhead to the user.
|
|
This is an extension to commit b4fdcebe ("T3165: prevent override of populated
node.def file with empty content") which implemented the same thing for the
configuration mode commands.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Else they all are unavailable for operator level users.
|
|
|
|
Unlike conf mode tag nodes, op mode "pseudo-tag nodes" have the real
node.def inside the node.tag dir rather than at the top level.
The required node.def at the top level is populated with the help string
from the real one.
A side effect is that commands that take arguments now must have their own
words, e.g. "run show arp" and "run show arp eth0" is impossible and has to be
"run show arp" and "run show arp interface eth0", which is probably a good thing.
|
|
|
|
T420: Write op mode version of node.def generator
|