EC2: Don't count instances in 'shutting-down' as running (#60709)
state: shutting-down is a precursor to terminated and should be treated as such for exact_count. Fixes #55955
This commit is contained in:
parent
2f05953b52
commit
129e998276
1 changed files with 1 additions and 1 deletions
|
@ -600,7 +600,7 @@ def find_running_instances_by_count_tag(module, ec2, vpc, count_tag, zone=None):
|
||||||
for res in reservations:
|
for res in reservations:
|
||||||
if hasattr(res, 'instances'):
|
if hasattr(res, 'instances'):
|
||||||
for inst in res.instances:
|
for inst in res.instances:
|
||||||
if inst.state == 'terminated':
|
if inst.state == 'terminated' or inst.state == 'shutting-down':
|
||||||
continue
|
continue
|
||||||
instances.append(inst)
|
instances.append(inst)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue