Skip to contentSkip to conversation

lib/oe/distro_check: Remove '_proxy' on dict values used by urllib.open

PATCH New [email protected] 1 participant 1 message Oct 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/oe/distro_check: Remove '_proxy' on dict values used by urllib.open

From: Leonardo Sandoval <[email protected]>

There are two ways to pass the proxies values into urllib.open: exporting the environment variables *_proxy and passing as dictionary into the urllib.open call. The latter is currenty used and values should not have the '_proxy' string, so removing it. Also, ignore uppercase proxies, these are not taken into account by the library.

Tested on a network with proxy, adding 'inherit +="distrodata"' on local.conf with the following commands

for distrotask in distrodataall distro_checkall checklicenseall; do
bitbake universe -c $distrotask
done

[YOCTO #7567]

---
 meta/lib/oe/distro_check.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
meta/lib/oe/distro_check.py +2 -7
index b3419ce..f92cd2e 100644
@@ -10,13 +10,8 @@ def create_socket(url, d):
 
 def get_proxies(d):
     import os
-    proxykeys = ['HTTP_PROXY', 'http_proxy',
-                 'HTTPS_PROXY', 'https_proxy',
-                 'FTP_PROXY', 'ftp_proxy',
-                 'FTPS_PROXY', 'ftps_proxy',
-                 'NO_PROXY', 'no_proxy',
-                 'ALL_PROXY', 'all_proxy']
-    proxyvalues = map(lambda key: d.getVar(key, True), proxykeys)
+    proxykeys = ['http', 'https', 'ftp', 'ftps', 'no', 'all']
+    proxyvalues = map(lambda key: d.getVar(key+'_proxy', True), proxykeys)
     return dict(zip(proxykeys, proxyvalues))
 
 def get_links_from_url(url, d):
Signature · 1 line
1.8.4.5