pyang icon indicating copy to clipboard operation
pyang copied to clipboard

choice is shown as data node when jstree plugin is used

Open pramodak opened this issue 3 years ago • 2 comments

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.

pyang_jstree_test.zip

pramodak avatar Apr 06 '21 14:04 pramodak

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):

pramodak avatar Apr 07 '21 08:04 pramodak

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.

missaesasaya avatar May 16 '22 18:05 missaesasaya