oestats-client: restore support for proxies
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Tue, 28 Jul 2009 09:13:37 +0000 (13:13 +0400)
committerDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Tue, 28 Jul 2009 09:13:37 +0000 (13:13 +0400)
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
classes/oestats-client.bbclass

index e6b8485..e4e6206 100644 (file)
@@ -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)