Remove redundant group host setup

It seems that all the code path that ends up calling [1] goes through
[2] before so setting up group host at [1] is redundant.

[1] c7e9e66742/nova/scheduler/utils.py (L944-L950)
[2] c7e9e66742/nova/scheduler/utils.py (L996-L1000)

Change-Id: I745aecb008f0867fcda2d3d2c7691621dd8f6168
Closes-Bug: #1788527
This commit is contained in:
Balazs Gibizer 2019-06-18 13:17:27 +02:00
parent a628d2f09a
commit f108d79676
1 changed files with 1 additions and 7 deletions

View File

@ -941,13 +941,7 @@ def _get_group_details(context, instance_uuid, user_group_hosts=None):
raise exception.UnsupportedPolicyException(reason=msg)
# NOTE(melwitt): If the context is already targeted to a cell (during a
# move operation), we don't need to scatter-gather.
if context.db_connection:
# We don't need to target the group object's context because it was
# retrieved with the targeted context earlier in this method.
group_hosts = set(group.get_hosts())
else:
group_hosts = set(_get_instance_group_hosts_all_cells(context,
group))
group_hosts = set(group.get_hosts())
user_hosts = set(user_group_hosts) if user_group_hosts else set()
return GroupDetails(hosts=user_hosts | group_hosts,
policy=group.policy, members=group.members)