Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions smoketests/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ def host_ports(self, docker) -> set[int]:
"""
host_ports = set()
info = docker.inspect_container(self)
for ports in info['NetworkSettings']['Ports'].values():
for ip_and_port in ports:
host_port = ip_and_port.get("HostPort")
if host_port:
host_ports.add(host_port)
for ports in info.get('NetworkSettings', {}).get('Ports', {}).values():
if ports:
for ip_and_port in ports:
host_port = ip_and_port.get("HostPort")
if host_port:
host_ports.add(host_port)
return host_ports

def is_running(self, docker, ping_url: Callable[[int], str]) -> bool:
Expand Down
Loading