[cloud] ec2_asg: wait for the lifecycle hooks - Fixes #37281 (#37282)

Wait for the lifecycle hooks by matching states `Terminating:Wait` and `Terminating:Proceed` in addition to `Terminating`.
This commit is contained in:
Alessandro Arnone 2018-03-19 18:59:07 +00:00 committed by Sloane Hertel
parent 357beeb7ae
commit ffd1200948

View file

@ -1368,7 +1368,7 @@ def wait_for_term_inst(connection, term_instances):
lifecycle = instance_facts[i]['lifecycle_state']
health = instance_facts[i]['health_status']
module.debug("Instance %s has state of %s,%s" % (i, lifecycle, health))
if lifecycle == 'Terminating' or health == 'Unhealthy':
if lifecycle.startswith('Terminating') or health == 'Unhealthy':
count += 1
time.sleep(10)