-
Notifications
You must be signed in to change notification settings - Fork 7
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
[scheduler] Consolidate host_info/passes steps in filter & weigher #365
base: stable/rocky-m3
Are you sure you want to change the base?
[scheduler] Consolidate host_info/passes steps in filter & weigher #365
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
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
return same_host | |
return set() |
Should we re-open this on xena? |
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