Change in vdsm[master]: deployUtil: do not mix socket and httplib

dougsland at redhat.com dougsland at redhat.com
Sun Apr 27 07:19:21 UTC 2014


Douglas Schilling Landgraf has uploaded a new change for review.

Change subject: deployUtil: do not mix socket and httplib
......................................................................

deployUtil: do not mix socket and httplib

To download the authkeys currently we are mixing socket and httplib
which is not required and can lead to error and not downloading the
authkeys. This patch keeps only httplib.

Change-Id: I81b1518e89362cdc9c4eea790e827c5d05ca1e80
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1065368
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
---
M vdsm_reg/deployUtil.py.in
1 file changed, 0 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/91/27091/1

diff --git a/vdsm_reg/deployUtil.py.in b/vdsm_reg/deployUtil.py.in
index cfea8a7..b49c36a 100644
--- a/vdsm_reg/deployUtil.py.in
+++ b/vdsm_reg/deployUtil.py.in
@@ -1375,23 +1375,6 @@
     return fReturn
 
 
-def getSSLSocket(sock, certPath=None):
-    """
-        Returns ssl socket according to python version
-    """
-    try:
-        import ssl
-        if not certPath:
-            return ssl.wrap_socket(sock)
-        else:
-            return ssl.wrap_socket(sock, ca_certs=certPath,
-                                   cert_reqs=ssl.CERT_REQUIRED)
-    except ImportError:
-        # in python 2.4 importing ssl will fail
-        ssl = socket.ssl(sock)
-        return httplib.FakeSocket(sock, ssl)
-
-
 def createCSR(orgName, subject, random_num, tsDir, vdsmKey):
     template = """
     RANDFILE               = ~/.rnd
@@ -1553,9 +1536,6 @@
                   (IP, port, fileName))
     data = None
     response = None
-    conn = None
-    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
-    sock.settimeout(timeout)
     fOK = True
 
     try:
@@ -1563,9 +1543,7 @@
         if port is not None:
             nPort = int(port)
 
-        sock.connect((IP, nPort))
         conn = httplib.HTTPSConnection(IP, nPort)
-        conn.sock = getSSLSocket(sock, certPath)
         conn.request("GET", fileName)
         response = conn.getresponse()
     except:


-- 
To view, visit http://gerrit.ovirt.org/27091
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81b1518e89362cdc9c4eea790e827c5d05ca1e80
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>


More information about the vdsm-patches mailing list