:fix fix parser port parse error

This commit is contained in:
uccu 2022-05-22 01:54:41 +08:00
parent 1c96d6f9f2
commit 473033d3f5

View file

@ -59,7 +59,7 @@ class Parser:
if service.get("ports"): if service.get("ports"):
if type(service["ports"]) is list: if type(service["ports"]) is list:
for port_data in service["ports"]: for port_data in service["ports"]:
if not port_data.contains(":"): if ':' not in port_data:
raise RuntimeError("Invalid ports input, aborting.") raise RuntimeError("Invalid ports input, aborting.")
spilt_data = port_data.split(":", 1) spilt_data = port_data.split(":", 1)
service_ports.append(Port(host_port=spilt_data[0], service_ports.append(Port(host_port=spilt_data[0],