Skip to content

Commit

Permalink
Take care of cases where 'build' role is not present
Browse files Browse the repository at this point in the history
Also we wrongly depend on the build-host name rather than looking at the role

Change-Id: Ida3569f3e74c75951c82965e04e669ef0a73a102
Closes-Bug: #1730482
  • Loading branch information
Senthilnathan Murugappan committed Nov 6, 2017
1 parent 9e50ae6 commit ada5754
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions fabfile/utils/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,12 @@ def get_priority_group_details(compute_host_string):
def get_compute_migrate_nodes():
"""Identify the list if compute nodes with build host as last in the list.
"""
compute_list = []
for hstr in env.roledefs['compute']:
if hstr == testbed.host_build:
continue
compute_list.append(hstr)
if testbed.host_build in env.roledefs['compute']:
compute_list.append(testbed.host_build)

return compute_list
build_hosts = env.roledefs.get('build') or []
compute_hosts = list(env.roledefs.get('compute') or [])
for host in set(compute_hosts).intersection(build_hosts):
compute_hosts.remove(host)
compute_hosts.append(host)
return compute_hosts

def get_qos_nodes():
"""Identifies the list of nodes to be provisioned for
Expand Down

0 comments on commit ada5754

Please sign in to comment.