Remove item only when the list is not empty

This commit fixes the case where the fault injected containers take
longer time to recover as the current checks are bombing out if the
list is empty.
This commit is contained in:
Naga Ravi Chaitanya Elluri
2021-10-28 12:12:45 -04:00
parent 87aa9eef4d
commit 43b1e5b727
+3 -2
View File
@@ -182,8 +182,9 @@ def check_failed_containers(killed_container_list, wait_time):
if statuses["name"] == killed_container[2]:
if str(statuses["ready"]).lower() == "true":
container_ready.append(killed_container)
for item in container_ready:
killed_container_list = killed_container_list.remove(item)
if len(container_ready) != 0:
for item in container_ready:
killed_container_list = killed_container_list.remove(item)
if killed_container_list is None or len(killed_container) == 0:
return []
timer += 5