From a5b0fa507808a143f13208476c56a306c5ad52dd Mon Sep 17 00:00:00 2001 From: Xyphuz Date: Mon, 23 May 2022 23:24:20 +0800 Subject: [PATCH] feat: implement depends_on long syntax --- compose_viz/parser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/compose_viz/parser.py b/compose_viz/parser.py index ad5e325..0f7a5a3 100644 --- a/compose_viz/parser.py +++ b/compose_viz/parser.py @@ -145,10 +145,15 @@ class Parser: service_depends_on: List[str] = [] if service.get("depends_on"): - service_depends_on = service["depends_on"] + if type(service["depends_on"]) is list: + for depends_on in service["depends_on"]: + service_depends_on.append(str(depends_on)) + elif type(service["depends_on"]) is dict: + service_depends_on = list(service["depends_on"].keys()) service_volumes: List[Volume] = [] if service.get("volumes"): + assert type(service["volumes"]) is list for volume_data in service["volumes"]: if type(volume_data) is dict: assert volume_data["source"] and volume_data["target"], "Invalid volume input, aborting."