mgr/cephadm: Some more typing#36497
Merged
sebastian-philipp merged 2 commits intoceph:masterfrom Aug 10, 2020
Merged
Conversation
Make sure we don't mix daemon names, config entities and auth entities. Cause all of them don't mix well together. Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
3 tasks
mgfritch
approved these changes
Aug 8, 2020
Contributor
mgfritch
left a comment
There was a problem hiding this comment.
couple of nits otherwise lgtm!
|
|
||
| def name_to_auth_entity(daemon_type: str, | ||
| daemon_id: str, | ||
| host: str = "", |
Contributor
There was a problem hiding this comment.
Suggested change
| host: str = "", | |
| host: Optional[str] = None, |
Contributor
Author
There was a problem hiding this comment.
Hm that change was made by @jmolmo a few weeks back. I didn't want to revert this.
| return 'client.' + daemon_type + "." + daemon_id | ||
| return AuthEntity('client.' + daemon_type + "." + daemon_id) | ||
| elif daemon_type == 'crash': | ||
| if host == "": |
Contributor
There was a problem hiding this comment.
Suggested change
| if host == "": | |
| if not host: |
mgfritch
reviewed
Aug 8, 2020
| if host == "": | ||
| raise OrchestratorError("Host not provided to generate <crash> auth entity name") | ||
| return 'client.' + daemon_type + "." + host | ||
| return AuthEntity('client.' + daemon_type + "." + host) |
Contributor
There was a problem hiding this comment.
Suggested change
| return AuthEntity('client.' + daemon_type + "." + host) | |
| return AuthEntity(f'client.{daemon_type}.{host}') |
would an f-string be more readable?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Make sure we don't mix daemon names, config entities and
auth entities. Cause all of them don't mix well together.
Signed-off-by: Sebastian Wagner sebastian.wagner@suse.com
Another fallout from #36432
Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume tox