diff options
author | Scott Dodson <sdodson@redhat.com> | 2016-04-22 17:01:36 -0400 |
---|---|---|
committer | Scott Dodson <sdodson@redhat.com> | 2016-04-25 10:51:43 -0400 |
commit | b90d2e6e80a7080d1753caba1251505383b998f9 (patch) | |
tree | 463ea61ca6169632911cd092ca856d8e4e87eb30 | |
parent | 1d467d5a34f446459dc5035b1ec7210fecce9931 (diff) | |
download | openshift-b90d2e6e80a7080d1753caba1251505383b998f9.tar.gz openshift-b90d2e6e80a7080d1753caba1251505383b998f9.tar.bz2 openshift-b90d2e6e80a7080d1753caba1251505383b998f9.tar.xz openshift-b90d2e6e80a7080d1753caba1251505383b998f9.zip |
Sort and de-dupe no_proxy list
-rwxr-xr-x | roles/openshift_facts/library/openshift_facts.py | 18 |
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: |