Skip to content

Commit f108d79

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
1 parent a628d2f commit f108d79

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

0 commit comments

Comments
 (0)