[oe-commits] Dmitry Eremin-Solenikov : oestats-client: restore support for proxies
git version control
git at git.openembedded.org
Tue Jul 28 09:27:12 UTC 2009
Module: openembedded.git
Branch: org.openembedded.dev
Commit: 6ab46c6e2d7d71c1c17d114de8d0cc2048ba36da
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=6ab46c6e2d7d71c1c17d114de8d0cc2048ba36da
Author: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
Date: Tue Jul 28 13:13:37 2009 +0400
oestats-client: restore support for proxies
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
---
classes/oestats-client.bbclass | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/classes/oestats-client.bbclass b/classes/oestats-client.bbclass
index e6b8485..e4e6206 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)
More information about the Openembedded-commits
mailing list