mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
537 stars 344 forks source link

LeafRef DataType #617

Open masif-cs opened 4 years ago

masif-cs commented 4 years ago

Hi,

I am writing a script to process pyang tree output. I am not able to derive the DataType of LeafRef node. By LeaftRef I mean the following:

+--ro contains-child* -> ../../component/name

So the DataType of leaf node "contains-child" will be the DataType of "name" given by LeafRef(->)

Is there anyway to get/derive the LeafRef data type in pyang tree output?

fredgan commented 4 years ago

Sorry, currently, there's no option to print the original data type.

masif-cs commented 4 years ago

Can I expect this enhancement anytime soon?

wlupton commented 4 years ago

@masif-cs, perhaps you could write your own little plugin that outputs the information that you need?

Plugins can be quite simple. For example the name plugin (in pyang/plugins/name.py) is only 48 lines long. Even the tree plugin is only 548 lines long.