Open hellt opened 2 years ago
Yes this looks correct.
Thanks @mbj4668 Is there a way to then limit the output to only the single module that is augmented by many?
I.e. if I have module A which is augmented by modules B C D, how can I print with tree/jstree only the module A and not the rest?
There is tree-path for tree output, but if the path happens to be not only in module A I still get several modules...
You may try using the "--deviation" clause to invoke only the augmenting modules
pyang -f tree -o mytree.txt --deviation=srl_nokia-if-ip.yang --deviation=srl_nokia-if-mpls.yang .... srl_nokia-interfaces.yang
This should produce what you expect
Thanks @GermanoSMO that will require me to know which modules augment a certain module. Unfortunately I do not have this information beforehand.
What we ended up doing is creating a post-processing script that removes modules that doesn't have nodes of its own (these are the modules which only contain augment
instruction) from the resulting output
Hi pyang maintainers/users, I wonder what is the correct way to print a
-f tree
representation of a module which containers are augmented by other modules?The case in point I have is represented with the following yang files
The main module is contained within a file
srl_nokia-interfaces.yang
and other modules in this directory provides augmentation for it.For example a snippet from
srl_nokia-interfaces-lag.yang
:With such a composition of a modules, how do I process the main
srl_nokia-interfaces.yang
module that it will have all the augmentations?The only option that seems to work for me is to explicitly load all the yang files like that
Is it the (only) correct way?