summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-01-28 16:27:52 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-02-08 10:52:40 +0000
commitd0d85a4d6b6961b3558c9f875f3a621d71ffcf92 (patch)
treee6cd4ed904d1faf8eedd30dc5e96ea6e51daa38a /bitbake/lib/bb/fetch2
parent7226ce2830d8b61457a6bf54c3227e782cc2ca48 (diff)
downloadpoky-d0d85a4d6b6961b3558c9f875f3a621d71ffcf92.tar.gz
bitbake: bb/fetch2: Move export_proxies function from wget to utils.
In order to use in other modules since is a common function when needs to get proxies working. (Bitbake rev: 85c529044381895556d603a3974de22392646a22) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r--bitbake/lib/bb/fetch2/wget.py17
1 files changed, 1 insertions, 16 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index 5a31730a4a..fd25c42436 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -37,6 +37,7 @@ from bb.fetch2 import FetchMethod
37from bb.fetch2 import FetchError 37from bb.fetch2 import FetchError
38from bb.fetch2 import logger 38from bb.fetch2 import logger
39from bb.fetch2 import runfetchcmd 39from bb.fetch2 import runfetchcmd
40from bb.utils import export_proxies
40from bs4 import BeautifulSoup 41from bs4 import BeautifulSoup
41from bs4 import SoupStrainer 42from bs4 import SoupStrainer
42 43
@@ -219,22 +220,6 @@ class Wget(FetchMethod):
219 220
220 return resp 221 return resp
221 222
222 def export_proxies(d):
223 variables = ['http_proxy', 'HTTP_PROXY', 'https_proxy', 'HTTPS_PROXY',
224 'ftp_proxy', 'FTP_PROXY', 'no_proxy', 'NO_PROXY']
225 exported = False
226
227 for v in variables:
228 if v in os.environ.keys():
229 exported = True
230 else:
231 v_proxy = d.getVar(v, True)
232 if v_proxy is not None:
233 os.environ[v] = v_proxy
234 exported = True
235
236 return exported
237
238 class HTTPMethodFallback(urllib2.BaseHandler): 223 class HTTPMethodFallback(urllib2.BaseHandler):
239 """ 224 """
240 Fallback to GET if HEAD is not allowed (405 HTTP error) 225 Fallback to GET if HEAD is not allowed (405 HTTP error)