cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
418
Views
2
Helpful
1
Replies

I am facing an issue in crud_service update function in YDK, where it fails to fetch the instance of a nested class. I have fixed this issue. What are the next steps?

hemalathaa_s
Level 1
Level 1

Hi,

The update operation in crud_service.py has a _create_update_entity_filter function, which tries to read the entity in the module, the

update_filter = getattr(module, entity._meta_info().name)() fails to fetch the nested class instance(for example Interfaces.Interface() is not accessible) because of the behavior of python getattr function, which does not support consecutive attribute retrievals.

The fix for this issue can be to use the operator.attrgetattr() python function instead.


import operator


update_filter = operator.attrgetter(entity._meta_info().name)(module)()

Please look into this issue and provide a fix.

Thanks,

Hemalathaa

1 Accepted Solution

Accepted Solutions

abhirame
Cisco Employee
Cisco Employee

Thanks for your post. If you have a fix for this issue, please feel free to contribute to the ydk-gen repository (GitHub - CiscoDevNet/ydk-gen: Generate model-driven APIs from YANG models) by creating a pull request

View solution in original post

1 Reply 1

abhirame
Cisco Employee
Cisco Employee

Thanks for your post. If you have a fix for this issue, please feel free to contribute to the ydk-gen repository (GitHub - CiscoDevNet/ydk-gen: Generate model-driven APIs from YANG models) by creating a pull request