You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the Yang module contains a Yang 1.1 action statement then pyang bind fails with a TypeError.
For example, running pyang bind on the ietf-routing.yang module in RFC 8349 fails as follows:
$ pyang --plugindir $PYBINDPLUGIN -f pybind -o ietf-routing.py ietf-routing.yang
Traceback (most recent call last):
File "/usr/bin/pyang", line 444, in <module>
run()
File "/usr/bin/pyang", line 413, in run
emit_obj.emit(ctx, modules, fd)
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 203, in emit
build_pybind(ctx, modules, fd)
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 419, in build_pybind
get_children(ctx, fd, children, m, m)
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 760, in get_children
register_paths=register_paths,
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 1456, in get_element
register_paths=register_paths,
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 760, in get_children
register_paths=register_paths,
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 1456, in get_element
register_paths=register_paths,
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 760, in get_children
register_paths=register_paths,
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 1456, in get_element
register_paths=register_paths,
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 760, in get_children
register_paths=register_paths,
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 1456, in get_element
register_paths=register_paths,
File "/data/npw/tmp/pyangbind/pyangbind/plugin/pybind.py", line 820, in get_children
raise TypeError("unhandled keyword with children %s at %s" % (parent.keyword, parent.pos))
TypeError: unhandled keyword with children action at ietf-routing.yang:469
[This output is from running pyangbind master commit bcb1d86]
It would be preferable to ignore action statements and generate the rest of the Python code, or to support action statements in a similar fashion to RPCs.
The text was updated successfully, but these errors were encountered:
I also experienced that problem and did a quick and dirty fix. See here. You just need to add action to a specific list. (here is the required addition)
I know this is a dirty fix, but the generation works and the actions are ignored (empty classes are created).
JoseIgnacioTamayo
changed the title
pyang bind fails with TypeError on Yang action statement
Add support to pyangbind for "action" statement
Feb 23, 2024
If the Yang module contains a Yang 1.1 action statement then pyang bind fails with a TypeError.
For example, running pyang bind on the ietf-routing.yang module in RFC 8349 fails as follows:
[This output is from running pyangbind master commit bcb1d86]
It would be preferable to ignore action statements and generate the rest of the Python code, or to support action statements in a similar fashion to RPCs.
The text was updated successfully, but these errors were encountered: