[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`.
pull/37626/head
Alessandro Arnone 7 years ago committed by Sloane Hertel
parent 357beeb7ae
commit ffd1200948

@ -1368,7 +1368,7 @@ def wait_for_term_inst(connection, term_instances):
lifecycle = instance_facts[i]['lifecycle_state'] lifecycle = instance_facts[i]['lifecycle_state']
health = instance_facts[i]['health_status'] health = instance_facts[i]['health_status']
module.debug("Instance %s has state of %s,%s" % (i, lifecycle, health)) 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 count += 1
time.sleep(10) time.sleep(10)

Loading…
Cancel
Save