From 36900e12cdfca13793326a4857fdea96ccb4d07c Mon Sep 17 00:00:00 2001 From: "Mark T. Voelker" Date: Mon, 1 May 2017 19:16:58 -0700 Subject: [PATCH] Fix floating IP logic in destroy There's a logic bug in the destroy action: ip_flag is assuming string context when it should be assuming list context. This causes ip_flag to never get set to true and therefore floating IP's never get destroyed. This can lead to floating IP exhaustion, particularly in environments with a low number of allocatable floating IP's. This patch corrects the problem by fixing the logic to check for a list length of zero rather than an empty string. Change-Id: I0205ac406e604365560360fc2953a5e90e1c9be3 Depends-On: Ifa9eeb9d761d9801cab580445e6c43c8cf1dfdaa --- workloads/ansible/shade/k8s/roles/provision/tasks/destroy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workloads/ansible/shade/k8s/roles/provision/tasks/destroy.yml b/workloads/ansible/shade/k8s/roles/provision/tasks/destroy.yml index 9577835..e0b5e9e 100755 --- a/workloads/ansible/shade/k8s/roles/provision/tasks/destroy.yml +++ b/workloads/ansible/shade/k8s/roles/provision/tasks/destroy.yml @@ -2,7 +2,7 @@ - name: Setup release floating IP flag set_fact: - ip_flag: "{{ app_env.app_setting.ips[inventory_hostname] == '' }}" + ip_flag: "{{ app_env.app_setting.ips[inventory_hostname]|length == 0 }}" - name: Destroy the OpenStack VM os_server: