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
This commit is contained in:
Mark T. Voelker 2017-05-01 19:16:58 -07:00 committed by litong01
parent f455064066
commit 36900e12cd
1 changed files with 1 additions and 1 deletions

View File

@ -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: