make binds a list instead of a dict (to prevent overwriting when copying the same file to two places) (#2294)
This commit is contained in:
parent
1c01e826d6
commit
edc8698c14
1 changed files with 3 additions and 3 deletions
|
@ -695,7 +695,7 @@ class DockerManager(object):
|
||||||
self.binds = None
|
self.binds = None
|
||||||
self.volumes = None
|
self.volumes = None
|
||||||
if self.module.params.get('volumes'):
|
if self.module.params.get('volumes'):
|
||||||
self.binds = {}
|
self.binds = []
|
||||||
self.volumes = []
|
self.volumes = []
|
||||||
vols = self.module.params.get('volumes')
|
vols = self.module.params.get('volumes')
|
||||||
for vol in vols:
|
for vol in vols:
|
||||||
|
@ -713,7 +713,7 @@ class DockerManager(object):
|
||||||
self.module.fail_json(msg='invalid bind mode ' + parts[2])
|
self.module.fail_json(msg='invalid bind mode ' + parts[2])
|
||||||
else:
|
else:
|
||||||
mode = parts[2]
|
mode = parts[2]
|
||||||
self.binds[parts[0]] = {'bind': parts[1], 'mode': mode }
|
self.binds.append((parts[0], {'bind': parts[1], 'mode': mode}))
|
||||||
else:
|
else:
|
||||||
self.module.fail_json(msg='volumes support 1 to 3 arguments')
|
self.module.fail_json(msg='volumes support 1 to 3 arguments')
|
||||||
|
|
||||||
|
@ -1366,7 +1366,7 @@ class DockerManager(object):
|
||||||
|
|
||||||
expected_binds = set()
|
expected_binds = set()
|
||||||
if self.binds:
|
if self.binds:
|
||||||
for host_path, config in self.binds.iteritems():
|
for host_path, config in self.binds:
|
||||||
if isinstance(config, dict):
|
if isinstance(config, dict):
|
||||||
container_path = config['bind']
|
container_path = config['bind']
|
||||||
mode = config['mode']
|
mode = config['mode']
|
||||||
|
|
Loading…
Reference in a new issue