pyang icon indicating copy to clipboard operation
pyang copied to clipboard

Is there anyway I can get all the xpaths in a yang file with groupings ?

Open sarveshwar22 opened this issue 1 year ago • 1 comments

I was using pyang to get xpaths of a particular yang file like native.yang by doing pyang -f flatten -p {repo} {yang_file}​ I have some yang files like snmp.yang where the structure of yang file is like this -

module snmp{

grouping A { } grouping C{ } grouping D{ }

augment B{ uses A }

}

This command is returning empty list here. Any leaf/container under any grouping is not getting displayed. Any approach to solve this so that all xpaths would be returned?

sarveshwar22 avatar Feb 14 '24 04:02 sarveshwar22

You can add multiple yang files for you pyang -f flatten command. In your case the 'uses' statement is under an augment, so you have to also include the YANG module where B is defined so snmp.yang can augment it and create the whole tree.

szabolcsszekely avatar Jan 07 '25 15:01 szabolcsszekely