From: smbaker Date: Tue, 9 Aug 2011 23:58:18 +0000 (-0700) Subject: better timeout handling X-Git-Tag: sfa-1.0-30~2 X-Git-Url: http://git.onelab.eu/?p=sfa.git;a=commitdiff_plain;h=a447972b567c5d89bb811be6f2b3cccb0d9ce7a8 better timeout handling --- a447972b567c5d89bb811be6f2b3cccb0d9ce7a8 diff --cc sfa/util/xmlrpcprotocol.py index ca6bbea4,9232e07f..0c07accd --- a/sfa/util/xmlrpcprotocol.py +++ b/sfa/util/xmlrpcprotocol.py @@@ -46,13 -46,11 +46,14 @@@ class XMLRPCTransport(xmlrpclib.Transpo # host may be a string, or a (host, x509-dict) tuple host, extra_headers, x509 = self.get_host_info(host) if need_HTTPSConnection: - conn = HTTPSConnection(host, None, key_file=self.key_file, cert_file=self.cert_file, timeout=self.timeout) #**(x509 or {})) + #conn = HTTPSConnection(host, None, key_file=self.key_file, cert_file=self.cert_file, timeout=self.timeout) #**(x509 or {})) + conn = HTTPSConnection(host, None, key_file=self.key_file, cert_file=self.cert_file) #**(x509 or {})) else: - #conn = HTTPS(host, None, key_file=self.key_file, cert_file=self.cert_file, timeout=self.timeout) #**(x509 or {})) - conn = HTTPS(host, None, key_file=self.key_file, cert_file=self.cert_file) #**(x509 or {})) + try: + conn = HTTPS(host, None, key_file=self.key_file, cert_file=self.cert_file, timeout=self.timeout) #**(x509 or {})) + except TypeError: + # some versions don't have a timeout argument + conn = HTTPS(host, None, key_file=self.key_file, cert_file=self.cert_file) #**(x509 or {})) if hasattr(conn, 'set_timeout'): conn.set_timeout(self.timeout)