summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine Verlant <antoine@niboo.be>2017-05-08 10:09:36 +0200
committerAntoine Verlant <antoine@niboo.be>2017-05-08 10:09:36 +0200
commit933a303ede8b032ef56dee3c68f35b67b1ec4f98 (patch)
tree16f8280a4de84ae9862d40e98981484adc99ff3f
parentf127a9ffdc9db1a946c3d7943eaf16b207f33598 (diff)
downloaddocker-py-933a303ede8b032ef56dee3c68f35b67b1ec4f98.tar.gz
Fix the way the list of mounts is made for service.
Signed-off-by: Antoine Verlant <antoine@niboo.be>
-rw-r--r--docker/types/services.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/docker/types/services.py b/docker/types/services.py
index 9291c9b..a95e3e5 100644
--- a/docker/types/services.py
+++ b/docker/types/services.py
@@ -107,11 +107,14 @@ class ContainerSpec(dict):
if labels is not None:
self['Labels'] = labels
if mounts is not None:
+ parsed_mounts = []
for mount in mounts:
if isinstance(mount, six.string_types):
- mounts.append(Mount.parse_mount_string(mount))
- mounts.remove(mount)
- self['Mounts'] = mounts
+ parsed_mounts.append(Mount.parse_mount_string(mount))
+ else:
+ # If mount already parsed
+ parsed_mounts.append(mount)
+ self['Mounts'] = parsed_mounts
if stop_grace_period is not None:
self['StopGracePeriod'] = stop_grace_period