summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2009-07-28 13:13:37 +0400
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2009-07-28 13:13:37 +0400
commit6ab46c6e2d7d71c1c17d114de8d0cc2048ba36da (patch)
tree5ece9fcae7a549ec7b91d1c88f0d2b0e6183a554 /classes
parent6e75ec0e0df8fae7b5b3d53e691fcc584458a397 (diff)
oestats-client: restore support for proxies
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/oestats-client.bbclass7
1 files changed, 6 insertions, 1 deletions
diff --git a/classes/oestats-client.bbclass b/classes/oestats-client.bbclass
index e6b8485385..e4e6206ac4 100644
--- a/classes/oestats-client.bbclass
+++ b/classes/oestats-client.bbclass
@@ -50,7 +50,12 @@ def oestats_send(d, server, action, vars = {}, files = {}):
"Content-type": "multipart/form-data; boundary=%s" % bound,
"Content-length": str(len(body))}
- # send request using urllib2, proxies should be auto-detected
+ proxy = bb.data.getVar('HTTP_PROXY', d, True )
+ if (proxy):
+ phl = urllib2.ProxyHandler({'http' : proxy})
+ opener = urllib2.build_opener(phl)
+ urllib2.install_opener(opener)
+
actionURL = "%s%s" %(server, action)
req = urllib2.Request(actionURL, body, headers);
response = urllib2.urlopen(req)