pyangbind icon indicating copy to clipboard operation
pyangbind copied to clipboard

Error generating bindings for ietf-yang-library

Open mathieu-mercier opened this issue 8 years ago • 3 comments

I get the following error when I try to generate bindings for this model: http://www.netconfcentral.org/modules/ietf-yang-library

pyang --plugindir $PYBINDPLUGIN -f pybind -o binding.py ietf-yang-library.yang Traceback (most recent call last): File "/usr/local/bin/pyang", line 434, in run() File "/usr/local/bin/pyang", line 408, in run emit_obj.emit(ctx, modules, fd) File "/usr/local/lib/python2.7/site-packages/pyangbind/plugin/pybind.py", line 217, in emit build_pybind(ctx, modules, fd) File "/usr/local/lib/python2.7/site-packages/pyangbind/plugin/pybind.py", line 394, in build_pybind build_identities(ctx, defn['identity']) File "/usr/local/lib/python2.7/site-packages/pyangbind/plugin/pybind.py", line 433, in build_identities idstore.build_store_from_definitions(ctx, defnd) File "/usr/local/lib/python2.7/site-packages/pyangbind/helpers/identity.py", line 73, in build_store_from_definitions mod_ref_prefixes = module_import_prefixes(ctx) File "/usr/local/lib/python2.7/site-packages/pyangbind/helpers/misc.py", line 22, in module_import_prefixes for mod in ctx.modules: RuntimeError: dictionary changed size during iteration

mathieu-mercier avatar Apr 21 '17 15:04 mathieu-mercier

@mathieu-mercier I realize this is quite an old issue, but I believe this has been fixed with the recent work on the library.

I've just performed a test using the latest copy of the ietf-yang-library.yang, and was able to successfully generate bindings.

Note that I was not able to use the ietf-datastores.yang from netconfcentral.org, as it is outdated and has an invalid bare base statement on line 63. Instead, I had to use the latest version of the file copied directly from RFC 8342.

tarkatronic avatar Apr 26 '18 16:04 tarkatronic

Confirming that this is now working:

$pyang --plugindir $PYBINDPLUGIN -f pybind -o binding.py ietf-yang-library.yang
$ echo $?
0
$ file binding.py 
binding.py: Python script, ASCII text executable, with very long lines

wungad avatar Oct 18 '18 07:10 wungad

I'm still seeing this issue in the latest version. I'm unable to generate bindings for ietf-yang-library.yang or ietf-interfaces.yang I'm running the following version; pyang==2.0.1 pyangbind==0.8.1

gametack avatar Jul 16 '19 18:07 gametack

@gametack could you please indicate where are you getting the models from? A comment below stated that the latest models from https://tools.ietf.org/html/rfc8342#section-7

With the exact source of the models and versions you provided, we can attempt to reproduce. But already 2 comments indicate this actually works...

JoseIgnacioTamayo avatar Feb 23 '24 07:02 JoseIgnacioTamayo

Closing issues without recent activity

JoseIgnacioTamayo avatar Mar 27 '24 21:03 JoseIgnacioTamayo