Merge branch 'preserve-conf-dir-sort-order' into 'master'

remove duplicates from conf dirs while preserving order

See merge request ungleich-public/cdist!862
This commit is contained in:
poljakowski 2020-04-11 20:30:11 +02:00
commit 8af4f7993c

View file

@ -22,6 +22,7 @@
import subprocess
import os
from tempfile import TemporaryFile
from collections import OrderedDict
import cdist
import cdist.configuration
@ -199,7 +200,9 @@ def resolve_conf_dirs(configuration, add_conf_dirs):
if add_conf_dirs:
conf_dirs.extend(add_conf_dirs)
conf_dirs = set(conf_dirs)
# Remove duplicates.
conf_dirs = list(OrderedDict.fromkeys(conf_dirs))
return conf_dirs