Skip to content

Commit 0313d81

Browse files
author
Balazs Gibizer
committed
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] https://github.com/openstack/nova/blob/c7e9e667426a6d88d396a59cb40d30763a3265f9/nova/scheduler/utils.py#L944-L950 [2] https://github.com/openstack/nova/blob/c7e9e667426a6d88d396a59cb40d30763a3265f9/nova/scheduler/utils.py#L996-L1000 Change-Id: I745aecb008f0867fcda2d3d2c7691621dd8f6168 Closes-Bug: #1788527 (cherry picked from commit f108d79)
1 parent acd2daa commit 0313d81

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

nova/scheduler/utils.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -898,13 +898,7 @@ def _get_group_details(context, instance_uuid, user_group_hosts=None):
898898
raise exception.UnsupportedPolicyException(reason=msg)
899899
# NOTE(melwitt): If the context is already targeted to a cell (during a
900900
# move operation), we don't need to scatter-gather.
901-
if context.db_connection:
902-
# We don't need to target the group object's context because it was
903-
# retrieved with the targeted context earlier in this method.
904-
group_hosts = set(group.get_hosts())
905-
else:
906-
group_hosts = set(_get_instance_group_hosts_all_cells(context,
907-
group))
901+
group_hosts = set(group.get_hosts())
908902
user_hosts = set(user_group_hosts) if user_group_hosts else set()
909903
return GroupDetails(hosts=user_hosts | group_hosts,
910904
policy=group.policy, members=group.members)

0 commit comments

Comments
 (0)