From 32c744e82ad6f44e3521ff4ea68b60bca99caa0f Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Tue, 12 Apr 2016 16:01:45 -0400 Subject: [PATCH] make binds a list instead of a dict (to prevent overwriting when copying the same file to two places) (#2294) --- lib/ansible/modules/cloud/docker/docker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index 6eec36bd634..85b7b8fceed 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -699,7 +699,7 @@ class DockerManager(object): self.binds = None self.volumes = None if self.module.params.get('volumes'): - self.binds = {} + self.binds = [] self.volumes = [] vols = self.module.params.get('volumes') for vol in vols: @@ -717,7 +717,7 @@ class DockerManager(object): self.module.fail_json(msg='invalid bind mode ' + parts[2]) else: mode = parts[2] - self.binds[parts[0]] = {'bind': parts[1], 'mode': mode } + self.binds.append((parts[0], {'bind': parts[1], 'mode': mode})) else: self.module.fail_json(msg='volumes support 1 to 3 arguments') @@ -1370,7 +1370,7 @@ class DockerManager(object): expected_binds = set() if self.binds: - for host_path, config in self.binds.iteritems(): + for host_path, config in self.binds: if isinstance(config, dict): container_path = config['bind'] mode = config['mode']