pyangbind icon indicating copy to clipboard operation
pyangbind copied to clipboard

Raise error with unhandled parent type: case

Open mundofer opened this issue 9 years ago • 2 comments

In the file ietf-access-control-list.yang (https://github.com/YangModels/yang/blob/master/experimental/ietf/ACL-MODEL/ietf-access-control-list.yang) when I try to compile with pyangbind and Python 2, I get the error: File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pyangbind-0.5.8-py3.4.egg/pyangbind/plugin/pybind.py", line 860, in get_children raise TypeError("unhandled keyword with children %s" % parent.keyword) TypeError: unhandled keyword with children case

This seems to be associated to the YANG section of the file (line 145) because if I remove the block starting in "choice ace-ip-version {" it compiles:

    Entry.";
        choice ace-type {
          description
            "Type of access list entry.";
          case ace-ip {
                  description "IP Access List Entry.";
            choice ace-ip-version { 
              description 
                "IP version used in this Access List Entry.";
              case ace-ipv4 { 
                uses packet-fields:acl-ipv4-header-fields; 
              }
              case ace-ipv6 {
                uses packet-fields:acl-ipv6-header-fields;
              }
            }**
            uses packet-fields:acl-ip-header-fields;
          }

From what I can see pyangbind doesn't expect a parent of type "case". Is there any workaround?

mundofer avatar Aug 16 '16 10:08 mundofer

Has there been any progress on this case? I have a juniper configuration.yang file that I'm trying to use and it fails with exactly the same error, the offending sequence is:


             choice compute-node-identifier {
               case case_1 {
                 leaf mac-address {
                   description "MAC address of the network boot interface";
                   junos:must "(\".. interfaces\")";
                   junos:must-message "Must specify management interface";
                   junos:must "(\".. .. local-management\")";
                   junos:must-message "Must specify compute cluster local-management";
                   junos:must "(unique \"services app-engine compute-cluster <*> compute-node <*> mac-address $$\")";
                   junos:must-message "MAC address must be unique across compute clusters";
                   junos:must "(\".. interfaces\")";
                   junos:must-message "Must specify management interface";
                   junos:must "(\".. .. local-management\")";
                   junos:must-message "Must specify compute cluster local-management";
                   junos:must "(unique \"services app-engine compute-cluster <*> compute-node <*> mac-address $$\")";
                   junos:must-message "MAC address must be unique across compute clusters";
                   type mac-addr;
                 }
               }

Editing it is not really an option.

pshemk avatar May 19 '17 02:05 pshemk

I confirm the same issue as above with the junos configuration module.

ruissalo avatar May 23 '17 19:05 ruissalo

Possible fix in https://github.com/robshakir/pyangbind/pull/340

JoseIgnacioTamayo avatar Feb 23 '24 21:02 JoseIgnacioTamayo

https://github.com/robshakir/pyangbind/pull/340 was merged and included in https://github.com/robshakir/pyangbind/releases/tag/0.8.5

Considering this issue fixed. Please re-open if not.

JoseIgnacioTamayo avatar Mar 27 '24 20:03 JoseIgnacioTamayo