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

Don't remove lazy component from deferred until success #651

Merged
merged 1 commit into from
Sep 21, 2015

Conversation

jamesls
Copy link
Member

@jamesls jamesls commented Sep 18, 2015

Only delete the component from the deferred dict after
successfully creating the object from the factory as well as
injecting the instantiated value into the _components dict.

The bug is that is the factory object raises an exception,
we've already removed it from the deferred list (via the
.pop() call), but we haven't added anything to the _components
dict.

Because of this, the next time you try to make a call you'll
get an error message about an unknown component.

It also looks like there were no unit tests for this class.
It was only tested transitively before. I've added a set
of unit tests covering this behavior.

This was found while looking into aws/aws-cli#1515

cc @kyleknap @mtdowling @rayluo

Only delete the component from the deferred dict after
successfully creating the object from the factory as well as
injecting the instantiated value into the _components dict.

The bug is that is the factory object raises an exception,
we've already removed it from the deferred list (via the
.pop() call), but we haven't added anything to the _components
dict.

Because of this, the next time you try to make a call you'll
get an error message about an unknown component.

It also looks like there were no unit tests for this class.
It was only tested transitively before.  I've added a set
of unit tests covering this behavior.
@jamesls jamesls added the pr/needs-review This PR needs a review from a member of the team. label Sep 18, 2015
@kyleknap
Copy link
Contributor

Looks good. 🚢

@jamesls jamesls merged commit 1ed7846 into boto:develop Sep 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/needs-review This PR needs a review from a member of the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants