crane/cprocess.py

13 lines
513 B
Python
Raw Normal View History

2022-10-18 14:14:53 -05:00
# TODO add file for containers that need to be started
def build_cont_list(obj,hypercare_containers):
2022-10-17 17:18:17 -05:00
cont_list = []
for i, c in enumerate(obj):
if c["State"].lower() != "running":
2022-10-18 14:14:53 -05:00
if c["Names"][0].lstrip("/") in hypercare_containers:
print(f'index: {i} container: {c["Names"][0].lstrip("/")} State: {c["State"]} ID: {c["Id"]}')
cont_list.append(c)
2022-10-17 17:18:17 -05:00
print(len(cont_list))
2022-10-18 14:14:53 -05:00
return cont_list
def process_cont_list(full_cont_list, cont_fn):
pass