Ensure blacklisted nodes are not included in server_names

'ServerIdData' map actually returns 'None' ids for blacklisted
nodes for a role, as 'nova_server_resource' output is
evaluated with condition 'server_not_blacklisted'. This
results in get_server_names() returning these blacklisted
nodes with something like 'None: compute-1' and results
in issues when we write ansible_host_vars. As we don't intend to
write ansible_host_vars for blacklisted nodes, we can ignore
these from 'server_names'.

Closes-bug: #1856661
Change-Id: Iafecc885abac5583c07bc046bc4d541f5e1e1c00
(cherry picked from commit d407c96d17)
This commit is contained in:
Rabi Mishra 2019-12-17 12:32:54 +05:30 committed by Emilien Macchi
parent 515eb554b4
commit 13b77d3670
1 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,8 @@ class Config(object):
for idx, name in enumerate(shortnames):
if 'server_ids' in role_node_id_map:
server_id = role_node_id_map['server_ids'][role][idx]
servers[server_id] = name.lower()
if server_id is not None:
servers[server_id] = name.lower()
return servers
def get_deployment_data(self, stack,