summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts/library
diff options
context:
space:
mode:
authorScott Dodson <sdodson@redhat.com>2016-04-22 17:01:36 -0400
committerScott Dodson <sdodson@redhat.com>2016-04-25 10:51:43 -0400
commitb90d2e6e80a7080d1753caba1251505383b998f9 (patch)
tree463ea61ca6169632911cd092ca856d8e4e87eb30 /roles/openshift_facts/library
parent1d467d5a34f446459dc5035b1ec7210fecce9931 (diff)
downloadopenshift-b90d2e6e80a7080d1753caba1251505383b998f9.tar.gz
openshift-b90d2e6e80a7080d1753caba1251505383b998f9.tar.bz2
openshift-b90d2e6e80a7080d1753caba1251505383b998f9.tar.xz
openshift-b90d2e6e80a7080d1753caba1251505383b998f9.zip
Sort and de-dupe no_proxy list
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: