CiscoDevNet / ydk-gen

Generate model-driven APIs from YANG models
http://ciscodevnet.github.io/ydk-gen/
Apache License 2.0
137 stars 74 forks source link

YDK does not decode raw output for Cisco_IOS_XR_ip_rib_ipv4_oper.py #358

Closed madhusj13 closed 7 years ago

madhusj13 commented 7 years ago

I see the following error message being generated for Cisco_IOS_XR_ip_rib_ipv4_oper.py yang model.

READ operation completed

YPYModelError Traceback (most recent call last)

in () ----> 1 crud.read(provider,v4_rib.Rib()) /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/services/crud_service.pyc in read(self, provider, read_filter, only_config) 150 payload = self._execute_crud_operation_on_provider(provider, read_filter, 'READ', only_config) 151 --> 152 return provider.decode(payload, read_filter) 153 154 def _execute_crud_operation_on_provider(self, provider, entity, operation, only_config): /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/netconf_provider.pyc in decode(self, payload, read_filter) 89 90 def decode(self, payload, read_filter): ---> 91 return self.sp_instance.decode(payload, read_filter) 92 93 def execute(self, payload, operation): /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_provider_plugin.pyc in decode(self, payload, read_filter) 130 # ones we are interested find the field list 131 entity = self._create_top_level_entity_from_read_filter(read_filter) --> 132 XmlDecoder._bind_to_object(payload, entity, self._get_capabilities()) 133 # drill down to figure out the field access expression 134 # that matches the entity or entities to be returned /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _bind_to_object(payload, top_entity, capabilities, pretty_p) 63 rt = etree.fromstring(payload.encode('utf-8')).getroottree().getroot() 64 curr_rt = get_root(rt, top_entity, _yang_ns._namespaces) ---> 65 XmlDecoder._bind_to_object_helper(curr_rt, top_entity, active_deviation_tables, pretty_p='|-') 66 67 @staticmethod /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _bind_to_object_helper(root, entity, deviation_tables, pretty_p) 89 entity.__dict__[member.presentation_name] = instance 90 instance.parent = entity ---> 91 XmlDecoder._bind_to_object_helper(rt[0], instance, deviation_tables, pretty_p + '-|') 92 elif member.mtype == REFERENCE_LIST: 93 instance = entity.__dict__[member.presentation_name] /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _bind_to_object_helper(root, entity, deviation_tables, pretty_p) 101 child.parent = entity 102 instance.append(child) --> 103 XmlDecoder._bind_to_object_helper(rtchild, child, deviation_tables, pretty_p + '-l') 104 elif member.mtype == REFERENCE_IDENTITY_CLASS: 105 instance = XmlDecoder._bind_to_identity_helper(rt[0], member, entity) /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _bind_to_object_helper(root, entity, deviation_tables, pretty_p) 89 entity.__dict__[member.presentation_name] = instance 90 instance.parent = entity ---> 91 XmlDecoder._bind_to_object_helper(rt[0], instance, deviation_tables, pretty_p + '-|') 92 elif member.mtype == REFERENCE_LIST: 93 instance = entity.__dict__[member.presentation_name] /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _bind_to_object_helper(root, entity, deviation_tables, pretty_p) 101 child.parent = entity 102 instance.append(child) --> 103 XmlDecoder._bind_to_object_helper(rtchild, child, deviation_tables, pretty_p + '-l') 104 elif member.mtype == REFERENCE_IDENTITY_CLASS: 105 instance = XmlDecoder._bind_to_identity_helper(rt[0], member, entity) /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _bind_to_object_helper(root, entity, deviation_tables, pretty_p) 101 child.parent = entity 102 instance.append(child) --> 103 XmlDecoder._bind_to_object_helper(rtchild, child, deviation_tables, pretty_p + '-l') 104 elif member.mtype == REFERENCE_IDENTITY_CLASS: 105 instance = XmlDecoder._bind_to_identity_helper(rt[0], member, entity) /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _bind_to_object_helper(root, entity, deviation_tables, pretty_p) 89 entity.__dict__[member.presentation_name] = instance 90 instance.parent = entity ---> 91 XmlDecoder._bind_to_object_helper(rt[0], instance, deviation_tables, pretty_p + '-|') 92 elif member.mtype == REFERENCE_LIST: 93 instance = entity.__dict__[member.presentation_name] /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _bind_to_object_helper(root, entity, deviation_tables, pretty_p) 101 child.parent = entity 102 instance.append(child) --> 103 XmlDecoder._bind_to_object_helper(rtchild, child, deviation_tables, pretty_p + '-l') 104 elif member.mtype == REFERENCE_IDENTITY_CLASS: 105 instance = XmlDecoder._bind_to_identity_helper(rt[0], member, entity) /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _bind_to_object_helper(root, entity, deviation_tables, pretty_p) 82 entity.__dict__[member.presentation_name] = XmlDecoder._to_real_type(rt, member, entity) 83 elif member.mtype == REFERENCE_LEAFLIST: ---> 84 entity.__dict__[member.presentation_name] = XmlDecoder._to_real_list_type(rt, member, entity) 85 elif (member.mtype == REFERENCE_CLASS): 86 instance = entity.__dict__[member.presentation_name] /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/providers/_decoder.pyc in _to_real_list_type(cls, elems, member, entity) 147 if result is None: 148 return None --> 149 results.append(result) 150 results.parent = entity 151 return results /auto/hfr-mpls/users/madhshar/ats5.3.0/ydk/local/lib/python2.7/site-packages/ydk/types.pyc in append(self, item) 317 def append(self, item): 318 if item in self: --> 319 raise YPYModelError("{} already in list".format(item)) 320 lst_item = YListItem(item, self.parent, self.name) 321 super(YLeafList, self).append(lst_item) YPYModelError: 0 already in list
psykokwak4 commented 7 years ago

It seems like the payload returned from device has duplicated value 0 for leaf-list. This is not allowed by RFC. Could you send the payload to help identify this issue? Thanks.

einarnn commented 7 years ago

Suggest checking with the XR component team. Some of the Oper models have this issue, and we are dealing with it by raising bugs. This one may have already been caught.

Cheers,

Einar

ghost commented 7 years ago

closing this as it is a server-side error