Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sarveshwar22 opened this issue Feb 14, 2024 · 1 comment

Comments

@sarveshwar22
Copy link

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?

@szabolcsszekely
Copy link

szabolcsszekely commented Jan 7, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants