[scheduler] Consolidate host_info/passes steps in filter & weigher#365
Open
fwiesel wants to merge 1 commit intostable/rocky-m3from
Open
[scheduler] Consolidate host_info/passes steps in filter & weigher#365fwiesel wants to merge 1 commit intostable/rocky-m3from
fwiesel wants to merge 1 commit intostable/rocky-m3from
Conversation
Both host_info_requiring_instance_ids as well as host_passes/_weigh_object had duplicated code for extracting the instance-ids needed By consolidating them we reduce the code duplication. Change-Id: Icfc1d3e554ff0834dec35d52772996284dc0a5da
fe75123 to
6b6a76d
Compare
grandchild
requested changes
Oct 21, 2022
grandchild
left a comment
There was a problem hiding this comment.
Otherwise LGTM.
Sorry for taking so long to get to this, laptop trouble + vacation.
| return set(spec_obj.get_scheduler_hint('different_host')) | ||
| different_host = spec_obj.get_scheduler_hint('different_host') | ||
| if not different_host: | ||
| return different_host |
There was a problem hiding this comment.
Do you want to return a set always? If you do, then I'd do it explicitly, or else risk returning None or even an empty string:
Suggested change
| return different_host | |
| return set() |
| return set(spec_obj.get_scheduler_hint('same_host')) | ||
| same_host = spec_obj.get_scheduler_hint('same_host') | ||
| if not same_host: | ||
| return same_host |
There was a problem hiding this comment.
Same as above.
Suggested change
| return same_host | |
| return set() |
|
Should we re-open this on xena? |
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.
Both host_info_requiring_instance_ids as well as host_passes/_weigh_object had duplicated code for extracting the instance-ids needed By consolidating them we reduce the code duplication.
Change-Id: Icfc1d3e554ff0834dec35d52772996284dc0a5da