diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index 61086e5281e..7efde161aa9 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -717,7 +717,7 @@ class DockerManager(object): self.module.fail_json(msg='invalid bind mode ' + parts[2]) else: mode = parts[2] - self.binds.append((parts[0], {'bind': parts[1], 'mode': mode})) + self.binds.append("%s:%s:%s" % (parts[0], parts[1], mode)) else: self.module.fail_json(msg='volumes support 1 to 3 arguments') @@ -1370,14 +1370,8 @@ class DockerManager(object): expected_binds = set() if self.binds: - for host_path, config in self.binds: - if isinstance(config, dict): - container_path = config['bind'] - mode = config['mode'] - else: - container_path = config - mode = 'rw' - expected_binds.add("{0}:{1}:{2}".format(host_path, container_path, mode)) + for bind in self.binds: + expected_binds.add(bind) actual_binds = set() for bind in (container['HostConfig']['Binds'] or []):