Tailf:symlink nodes are not visible in pyang tree

Here is the use-case we have:
Module1 (/a/b)
module A {
container a {
tailf:hidden full;
leaf b{
type string;
Module2 (/c/a/b)
module C {
import A{ prefix A};
container c {
tailf:symlink a {
tailf:path “/A:a”;
Now I am trying to get pyang tree for module C.
pyang -p PATH_TO_YANG_FILES -f tree -o output.tree C.yang
it shows a warning message ‘imported module “A” not used’
and symlink nodes are not being shown under C.

Am I missing any options in pyang command?
When I checked in user_guide, it suggested to sanitize. But there is no information related to sanitize in pyang manual

Could someone help me on how to get symlink nodes in the tree?


@mnovak @cohult Could you please help me on this.
May be the specific question here is
We are using yang 1.1 version and the man pyang is not showing any of the tailf options.Example: --tailf-sanitize
I think in future we need to use yanger tool instead of pyang.
Does yanger supports above tailf sanitize options?

The short answer is - symlinks cannot be visible in a pyang output since tailf:symlink is a Tail-f custom extension and pyang, a general purpose tool, has no understanding of symlink semantics; this also explains why pyang does not see any usage of A in C and shows the warning, pyang does not interpret the argument of the statement tailf:path .

I am not sure if it is possible to make pyang understand symlinks (short of writing your own pyang plugin); but from a different perspective, do you need to use symlinks? They have been deprecated for quite some time now.

I ignored your question about sanitize: if you use the pyang executable distributed with confd, you can indeed use --tailf-sanitize (run pyang --help to see little bit about it). It is obviously capable of resolving symlinks, though not when using the tree format directly. You can do something like

pyang -f yang --tailf-sanitize C.yang | pyang -f tree

As far as I can tell yanger does not provide anything like --tailf-sanitize which is a pity since pyang distributed with ConfD does not seem to be actively maintained; or at least it lags behind the open-source pyang version, but the tailf plugin providing the sanitation options is not compatible with the newer version.