This repo is just a random collection of tools and scripts that I use to work with yang models
note: that most of these are "spaghetti code"
This script is something that I (quickly) slapped together to to make ydk-gen working. I had a bunch of issues validating the Cisco-IOS-XE-native.yang model and understanding how it all worked together..
Basically it does the following:
- loads all the models in the "model_path" path into a libyang collection
- loads the "model_name" and validates that.
- find all the models in the "model_path" that implements an Yang argument (extends a model)
- find all the "dead-end" containers in the "model_name"
- dead-end container is an empty container without leafs, leaflists etc.
- usually you would think a dead-end container would not implement the "presence".. eg. if the presence is set, then it would not be dead-end, but sometimes it actually does have that set and still there is a model that arguments it.
- Then maps all the "argumenting" models into dead-end containers so we can find "upstream" models that we want to include in the yang-model-set to get a complete model.
- finally prints some stats..
edit the model_path and model_name and just run it ;-)