From fb99277066c5c98c41d02290156b5e728520e38f Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Wed, 17 Aug 2016 16:54:39 -0400 Subject: [PATCH] Exposing tcp and udp for same port fails. Fixes issue #4354. --- lib/ansible/modules/cloud/docker/docker_container.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/docker/docker_container.py b/lib/ansible/modules/cloud/docker/docker_container.py index 0c7a77a19af..d1cdd952044 100644 --- a/lib/ansible/modules/cloud/docker/docker_container.py +++ b/lib/ansible/modules/cloud/docker/docker_container.py @@ -1012,7 +1012,8 @@ class TaskParameters(DockerBaseClass): protocol = 'tcp' match = re.search(r'(/.+$)', port) if match: - protocol = match.group(1) + protocol = match.group(1).replace('/', '') + port = re.sub(r'/.+$', '', port) exposed.append((port, protocol)) if published_ports: # Any published port should also be exposed