[dpdk-ci] [PATCH v4 7/7] tests: add checkpatch

Mcnamara, John john.mcnamara at intel.com
Fri Dec 9 13:11:00 CET 2016


> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Friday, December 9, 2016 10:11 AM
> To: Mcnamara, John <john.mcnamara at intel.com>
> Cc: Wei, FangfangX <fangfangx.wei at intel.com>; ci at dpdk.org; Xu, Qian Q
> <qian.q.xu at intel.com>; Liu, Yong <yong.liu at intel.com>; Chen, WeichunX
> <weichunx.chen at intel.com>
> Subject: Re: [dpdk-ci] [PATCH v4 7/7] tests: add checkpatch
> 
> 2016-12-09 10:07, Mcnamara, John:
> > From: ci [mailto:ci-bounces at dpdk.org] On Behalf Of Thomas Monjalon
> > > 2016-12-09 08:51, Wei, FangfangX:
> > > > My internet connection is working fine, and also configure
> > > > http_proxy
> > > and https_proxy, but the connection is still timeout.
> > > >
> > > > I think that's because the rpc client can't connect to your rpc
> server.
> > > Is there any other configuration should be configured?
> > >
> > > I've found it is an open issue. pwclient does not work with proxy:
> > > 	https://github.com/getpatchwork/patchwork/issues/47
> > >
> >
> > Hi,
> >
> > I have a hardcoded patch that allows pwclient to work within the Intel
> firewall. I'll send it on to the @intel.com people.
> 
> In the meantime, I'm trying to fix the issue upstream.
> And I'll send a v5 of these patches to be able to get the patch from
> patchwork without requiring pwclient.


Thomas,

For what it is worth here is my patch. It isn't a general solution since the proxy is hardcoded and also it doesn't work with a proxy that requires a password.

John



diff --git a/pwclient b/pwclient
index dfbea30..1652a7e 100755
--- a/pwclient
+++ b/pwclient
@@ -29,6 +29,7 @@ import subprocess
 import base64
 import ConfigParser
 import shutil
+import httplib
 
 # Default Patchwork remote XML-RPC server URL
 # This script will check the PW_XMLRPC_URL environment variable
@@ -80,6 +81,22 @@ class Filter:
         """Return human-readable description of the filter."""
         return str(self.d)
 
+class ProxiedTransport(xmlrpclib.Transport):
+
+    def set_proxy(self, proxy):
+        self.proxy = proxy
+
+    def make_connection(self, host):
+        self.realhost = host
+        h = httplib.HTTPConnection(self.proxy)
+        return h
+
+    def send_request(self, connection, handler, request_body):
+        connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler))
+
+    def send_host(self, connection, host):
+        connection.putheader('Host', self.realhost)
+
 class BasicHTTPAuthTransport(xmlrpclib.SafeTransport):
 
     def __init__(self, username = None, password = None, use_https = False):
@@ -431,7 +448,8 @@ def main():
     url = config.get(project_str, 'url')
 
     (username, password) = (None, None)
-    transport = None
+    transport = ProxiedTransport()
+    transport.set_proxy('proxy.mydomain.com:123')
     if action in auth_actions:
         if config.has_option(project_str, 'username') and \
                 config.has_option(project_str, 'password'):



More information about the ci mailing list