Skip to content

Commit

Permalink
ansible-test - allow for the same listening port on multiple interfac…
Browse files Browse the repository at this point in the history
…es (#75387)
  • Loading branch information
samdoran committed Aug 3, 2021
1 parent c8d4131 commit 1d2af0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
@@ -0,0 +1,2 @@
bugfixes:
- ansible-test - allow the same listening port on all container interfaces
2 changes: 1 addition & 1 deletion test/lib/ansible_test/_internal/containers.py
Expand Up @@ -524,7 +524,7 @@ def register(self, args): # type: (EnvironmentConfig) -> SupportContainer
# inspect the support container to locate the published ports
tcp_ports = dict((port, container.get_tcp_port(port)) for port in self.ports)

if any(not config or len(config) != 1 for config in tcp_ports.values()):
if any(not config or len(set(conf['HostPort'] for conf in config)) != 1 for config in tcp_ports.values()):
raise ApplicationError('Unexpected `docker inspect` results for published TCP ports:\n%s' % json.dumps(tcp_ports, indent=4, sort_keys=True))

published_ports = dict((port, int(config[0]['HostPort'])) for port, config in tcp_ports.items())
Expand Down

0 comments on commit 1d2af0b

Please sign in to comment.