fix the wait_until examples #69
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The example usage of
wait_until()w/parametersucceed_on_found=Trueare incorrect to the best of my understanding.When using the examples in this file I came across an issue deleting subnets. Specifically my
wait_until()calls would throw exceptions because of a 404 even though I had the succeed_on_not_found parameter set to True. After some help from @arthall (thanks Art!) I determined that the examples in this file are incorrect and will reliably error out when trying to use them.I believe the issue is the wait_until() call is unable to get a response object from the client.get() call when a non-tombstoning resource is deleted and disappears (resulting in 404) before it can get a response object to use for it's property check.
Proposed Fix
The proposed fix does a GET on the resource before calling wait_until() and then passes the resulting response to the wait_until() method. I have tested this fix locally a few times.
Reproduction steps
I get the following type of errors reliably: