Handle nodes with no ctlplane IP's during deny list handling

The deny list of IP addresses is returned as a list of empty strings,
e.g. ['', '', ...] in the case where nothing is denied.

This creates an issue for nodes that have no ctlplane IP addresses, such
as when using deployed-server and all services are moved to other
networks other than the ctlplane, and the ctlplane port for those nodes
are noop'd or not set in DeployedServerPortMap. In that case, the
ctlplane IP for those nodes is also returned as an empty string, in
which case the code was trying to process the node as denied since it
found a match of empty string in the list.

This change adds a simple check that the denied IP is not none, in which
case the deny logic handling is skipped.

Change-Id: I5b38abd4c5ce0631f3f701a6fe907ffb7b0bbdf2
Signed-off-by: James Slagle <jslagle@redhat.com>
This commit is contained in:
James Slagle 2021-04-20 07:25:19 -04:00
parent e8ebcc3c7e
commit 6e21e00c8d
1 changed files with 2 additions and 0 deletions

View File

@ -131,6 +131,8 @@ def get_overcloud_hosts(stack, ssh_network):
# for each blacklisted ctlplane ip, remove the corresponding
# ssh_network ip at that same index in the net_ips list
for bcip in blacklisted_ctlplane_ips:
if not bcip:
continue
index = ctlplane_ips.index(bcip)
ctlplane_ips.pop(index)
net_ips.pop(index)