From 3ee6f17a53d312fdda57ba275f4f22f9075439a0 Mon Sep 17 00:00:00 2001 From: "Yakubov, Sergey" Date: Fri, 10 Feb 2023 14:42:38 -0500 Subject: [PATCH] fix hostname parsing for newer Docker versions newer versions seem to return "[::]" instead "::", we check that as well --- lib/galaxy/tool_util/deps/docker_util.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/tool_util/deps/docker_util.py b/lib/galaxy/tool_util/deps/docker_util.py index dade02ba898..0c02636e06e 100644 --- a/lib/galaxy/tool_util/deps/docker_util.py +++ b/lib/galaxy/tool_util/deps/docker_util.py @@ -198,6 +198,11 @@ def parse_port_text(port_text): >>> slurm_ports[8888]['host'] '0.0.0.0' >>> ports = parse_port_text("5432/tcp -> :::5432") + >>> len(ports) + 0 + >>> ports_new = parse_port_text("5432/tcp -> [::]:5432") + >>> len(ports_new) + 0 """ ports = None if port_text is not None: @@ -207,7 +212,7 @@ def parse_port_text(port_text): raise Exception(f"Cannot parse host and port from line [{line}]") tool, host = line.split(" -> ", 1) hostname, port = host.rsplit(":", 1) - if hostname == "::": + if hostname in ["::", "[::]"]: # Skip unspecified IPv6 address, which is also specified as 0:0:0:0 in another line. # This is brittle of course, but so is parsing the container ports like this. continue