pyang
pyang copied to clipboard
choice is shown as data node when jstree plugin is used
When we have a choice schema node, with case nodes, the choice node should not be shown as a data node in the path. Please see the attachments for the jstree screenshot with the wrong path highlighted and the yang file used.
I think, the below change is needed to rectify this issue? - Could someone please verify and do the change?
index e0e4f77..cf40847 100644
--- a/pyang/statements.py
+++ b/pyang/statements.py
@@ -3310,7 +3310,7 @@ def mk_path_list(stmt):
"""
resolved_names = []
def resolve_stmt(stmt, resolved_names):
- if stmt.keyword in ['case', 'input', 'output']:
+ if stmt.keyword in ['choice', 'case', 'input', 'output']:
resolve_stmt(stmt.parent, resolved_names)
return
def qualified_name_elements(stmt):
Any news on this? I am also having this problem when generating xpaths (-f flatten) which I use to generate automated tests. I am not able to test choices due to this issue.