[NEW PATCH] SecureXMLRPC: work with python 2.7, too. (via gerrit-bot)
Dan Kenigsberg
danken at redhat.com
Wed Sep 14 20:00:51 UTC 2011
New patch submitted by Dan Kenigsberg (danken at redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/800
commit edf8af78b0a2f3a470bbc2059b1431f32bf0295b
Author: Dan Kenigsberg <danken at redhat.com>
Date: Sun Mar 6 11:57:30 2011 +0200
SecureXMLRPC: work with python 2.7, too.
Change-Id: Id09274ed848632aced7f66bf5322f2f5204ce89e
diff --git a/vdsm/SecureXMLRPCServer.py b/vdsm/SecureXMLRPCServer.py
index b544741..0d68325 100644
--- a/vdsm/SecureXMLRPCServer.py
+++ b/vdsm/SecureXMLRPCServer.py
@@ -129,9 +129,17 @@ class VerifyingSafeTransport(xmlrpclib.SafeTransport):
self.cert_reqs = cert_reqs
def make_connection(self, host):
- """Return VerifyingHTTPS object that is aware of ca_certs, and will create VerifyingHTTPSConnection"""
+ """Return VerifyingHTTPS object that is aware of ca_certs, and will
+ create VerifyingHTTPSConnection.
+ In Python 2.7, return VerifyingHTTPSConnection object"""
chost, self._extra_headers, x509 = self.get_host_info(host)
- return VerifyingHTTPS(
+ if hasattr(xmlrpclib.SafeTransport, "single_request"): # Python 2.7
+ return VerifyingHTTPSConnection(
+ chost, None, key_file=self.key_file, strict=None,
+ cert_file=self.cert_file, ca_certs=self.ca_certs,
+ cert_reqs=self.cert_reqs)
+ else:
+ return VerifyingHTTPS(
chost, None, key_file=self.key_file,
cert_file=self.cert_file, ca_certs=self.ca_certs,
cert_reqs=self.cert_reqs)
More information about the vdsm-patches
mailing list