-
Notifications
You must be signed in to change notification settings - Fork 77
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
Make wait_for_endpoints more robust. #1172
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: the function's name is a bit strange ... it's waiting, but also returning a value ... the "waiting" seems to be irrelevant from the caller's perspective, why not call it "get_keystone_client"?, or maybe re-use get_keystone_client()[0] and wrap that one with a retry() decorator?, if there is a concern about the retry on a core function like this one, the number of retries could be an argument that defaults to 1
[0] https://github.com/openstack-charmers/zaza-openstack-tests/blob/master/zaza/openstack/utilities/openstack.py#L616
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the function's name is wrong. I don't think that
get_keystone_client()
can be used as it seems more basic that this function; i.e. it's using overcloud auth rather than openrc.I think this function ought to be in
z.o.utilities.openstack.py
though along with the other keystone client functions which would also open a space for refactoring at a future point.Finally, the
wait_for_url()
function is also really generic and probably could also live in a utility module; thewait_for_all_endpoints()
a bit more arguable as to where it should go. It's specific enother to be testing keystone ... but also generic enough that other tests might also want to wait on the endpoints being available as a utility.