Hi,

I have another note regarding the standardization of tree diagrams - the 
<prefix> is not clearly defined. pyang --tree-help says:

   <name> is the name of the node
    (<name>) means that the node is a choice node
   :(<name>) means that the node is a case node

   If the node is augmented into the tree from another module, its
   name is printed as <prefix>:<name>.

pyang uses the prefix value from the import statement in the module being 
printed. This approach can result in confusing output when e.g. module and its 
submodule import a) same module with different prefixes or b) different modules 
with a same prefix. However, not even use of the prefix defined in the module 
itself solve the issue. YANG has no requirement for the module prefixes, so 
they can repeat in different modules.

The solution I see here, and which is actually already used in JSON encoding of 
YANG modeled data, is using module names as prefixes. This approach is also 
implemented in yanglint (there was no standardization of the tree format, so as 
developers we have decided to slightly modify the format in comparison to what 
is printed by pyang). The price for the exactness is the width of the output - 
prefixes used to be shorter than the full module names.

Regards,
Radek

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to