Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crud update fix #481

Merged
3 commits merged into from
Jun 27, 2017
Merged

crud update fix #481

3 commits merged into from
Jun 27, 2017

Conversation

shemalathaa
Copy link
Contributor

The update operation in crud_service.py has a _create_update_entity_filter function, which tries to read the entity in the module, but the update_filter fails to fetch the nested class instance, 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.

@@ -206,7 +206,7 @@ def _create_update_entity_filter(self, entity):
raise YPYServiceError(error_msg=err_msg)

module = importlib.import_module(entity._meta_info().pmodule_name)
update_filter = getattr(module, entity._meta_info().name)()
update_filter = operator.attrgetter(entity._meta_info().name)(module)()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. Need to import the operator module. This is causing the CI to fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the change in the same commit. Thanks.

@codecov-io
Copy link

codecov-io commented Jun 26, 2017

Codecov Report

Merging #481 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #481      +/-   ##
==========================================
- Coverage   84.01%   83.99%   -0.03%     
==========================================
  Files         109      109              
  Lines       13050    13051       +1     
  Branches     1885     1885              
==========================================
- Hits        10964    10962       -2     
- Misses       1566     1572       +6     
+ Partials      520      517       -3
Impacted Files Coverage Δ
sdk/python/core/ydk/services/crud_service.py 71.08% <100%> (+4.01%) ⬆️
ydkgen/builder/test_case/test_cases_builder.py 77.69% <0%> (-2.16%) ⬇️
ydkgen/builder/test_case/test_value_builder.py 91.21% <0%> (-0.84%) ⬇️
...cases/python/expected/ydk/models/ydktest_sanity.py 74.67% <0%> (ø) ⬆️
sdk/python/core/ydk/providers/_provider_plugin.py 73.72% <0%> (+0.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3427bee...660ceb2. Read the comment docs.

@ghost ghost merged commit e20c6cb into CiscoDevNet:master Jun 27, 2017
@ghost
Copy link

ghost commented Jun 27, 2017

Thanks for your contribution!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants