From ad5e7924308cbb241f6297545e2b5dc67fabfc0a Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Thu, 28 Jan 2016 15:36:15 +0700 Subject: [PATCH] fix: lists will remove duplicate elements when merging yaml. This will solve the duplicate warning that docker-compose issues notably on ``links``. --- bin/compose | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/compose b/bin/compose index d12a07e..a4514a8 100755 --- a/bin/compose +++ b/bin/compose @@ -78,7 +78,10 @@ def merge(*args): elif all(isinstance(arg, list) for arg in args): res = [] for arg in args: - res.extend(arg) + for elt in arg: + if elt in res: + res.remove(elt) + res.append(elt) return res elif all(isinstance(arg, dict) for arg in args): keys = set()