Skip to content

Commit

Permalink
Merge 0aa1803 into f017f5a
Browse files Browse the repository at this point in the history
  • Loading branch information
EricMountain-1A committed Mar 7, 2017
2 parents f017f5a + 0aa1803 commit 8fa6668
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions roles/openshift_facts/library/openshift_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2319,14 +2319,19 @@ def init_local_facts(self, facts=None,
protected_facts_to_overwrite)

if 'docker' in new_local_facts:
# remove duplicate and empty strings from registry lists
# remove duplicate and empty strings from registry lists, preserving order
for cat in ['additional', 'blocked', 'insecure']:
key = '{0}_registries'.format(cat)
if key in new_local_facts['docker']:
val = new_local_facts['docker'][key]
if isinstance(val, string_types):
val = [x.strip() for x in val.split(',')]
new_local_facts['docker'][key] = list(set(val) - set(['']))
seen = set()
new_local_facts['docker'][key] = list()
for registry in val:
if registry not in seen and registry != '':
seen.add(registry)
new_local_facts['docker'][key].append(registry)
# Convert legacy log_options comma sep string to a list if present:
if 'log_options' in new_local_facts['docker'] and \
isinstance(new_local_facts['docker']['log_options'], string_types):
Expand Down

0 comments on commit 8fa6668

Please sign in to comment.