still testing²
This commit is contained in:
58
main.py
58
main.py
@@ -129,36 +129,36 @@ def yaml_file_to_container_list(filepath: str) -> list|None:
|
|||||||
:param filepath: str
|
:param filepath: str
|
||||||
:return: dict|None
|
:return: dict|None
|
||||||
'''
|
'''
|
||||||
|
pass
|
||||||
|
|
||||||
|
# dependances = []
|
||||||
dependances = []
|
# if "depends_on" in ycontent["services"][servicename]:
|
||||||
if "depends_on" in ycontent["services"][servicename]:
|
# dependances = ycontent["services"][servicename]["depends_on"]
|
||||||
dependances = ycontent["services"][servicename]["depends_on"]
|
#
|
||||||
|
# bindslist = []
|
||||||
bindslist = []
|
# volumeslist = []
|
||||||
volumeslist = []
|
# for mount in ycontent["services"][servicename]["volumes"]:
|
||||||
for mount in ycontent["services"][servicename]["volumes"]:
|
# localpart = mount.split(":")
|
||||||
localpart = mount.split(":")
|
# # TODO: adapter avec pathlib pour gérer Windows
|
||||||
# TODO: adapter avec pathlib pour gérer Windows
|
# # si un /, signifie qu'il s'agit d'un chemin et donc d'un bind mount, pas volume.
|
||||||
# si un /, signifie qu'il s'agit d'un chemin et donc d'un bind mount, pas volume.
|
# if localpart.find("/") != -1:
|
||||||
if localpart.find("/") != -1:
|
# bindslist.append(localpart)
|
||||||
bindslist.append(localpart)
|
# else:
|
||||||
else:
|
# volumeslist.append(localpart)
|
||||||
volumeslist.append(localpart)
|
#
|
||||||
|
# containersid = os.popen(f"docker-compose --file {filepath} ps --quiet {servicename}").readlines()
|
||||||
containersid = os.popen(f"docker-compose --file {filepath} ps --quiet {servicename}").readlines()
|
# containersnames = os.popen(f"docker-compose --file {filepath} ps {servicename} | tail -n +3").readlines()
|
||||||
containersnames = os.popen(f"docker-compose --file {filepath} ps {servicename} | tail -n +3").readlines()
|
#
|
||||||
|
# containerslist = []
|
||||||
containerslist = []
|
# for i in range(0, len(containersid)):
|
||||||
for i in range(0, len(containersid)):
|
# containerslist.append((containersnames[i], containersid[i]))
|
||||||
containerslist.append((containersnames[i], containersid[i]))
|
#
|
||||||
|
# for containerfound in containerslist:
|
||||||
for containerfound in containerslist:
|
# container = {"service": servicename,
|
||||||
container = {"service": servicename,
|
# "name": containerfound[0],
|
||||||
"name": containerfound[0],
|
# "id": containerfound[1],
|
||||||
"id": containerfound[1],
|
# "binds": bindslist,
|
||||||
"binds": bindslist,
|
# "depends_on": dependances}
|
||||||
"depends_on": dependances}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user