summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts/library
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_facts/library')
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 4c4fd31e5..49658a2ee 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -1327,6 +1327,23 @@ def get_local_facts_from_file(filename):
return local_facts
+def sort_unique(alist):
+ """ Sorts and de-dupes a list
+
+ Args:
+ list: a list
+ Returns:
+ list: a sorted de-duped list
+ """
+
+ alist.sort()
+ out = list()
+ for i in alist:
+ if i not in out:
+ out.append(i)
+
+ return out
+
def safe_get_bool(fact):
""" Get a boolean fact safely.
@@ -1363,6 +1380,7 @@ def set_proxy_facts(facts):
common['no_proxy'].extend(common['no_proxy_internal_hostnames'].split(','))
common['no_proxy'].append('.' + common['dns_domain'])
common['no_proxy'].append(common['hostname'])
+ common['no_proxy'] = sort_unique(common['no_proxy'])
facts['common'] = common
if 'builddefaults' in facts: