admins can now update the site_id. This should make it easier to move nodes to differ...
[plcapi.git] / PLC / PyCurl.py
index 8352fd0..32051b4 100644 (file)
@@ -15,6 +15,7 @@ from tempfile import NamedTemporaryFile
 
 class PyCurlTransport(xmlrpclib.Transport):
     def __init__(self, uri, cert = None, timeout = 300):
+        xmlrpclib.Transport.__init__(self)
         self.curl = pycurl.Curl()
 
         # Suppress signals
@@ -64,13 +65,14 @@ class PyCurlTransport(xmlrpclib.Transport):
             errcode = self.curl.getinfo(pycurl.HTTP_CODE)
             response = self.body
             self.body = ""
+            errmsg="<no known errmsg>"
         except pycurl.error, err:
             (errcode, errmsg) = err
 
         if errcode == 60:
-            raise Exception, "SSL certificate validation failed"
+            raise Exception, "PyCurl: SSL certificate validation failed"
         elif errcode != 200:
-            raise Exception, "HTTP error %d" % errcode
+           raise Exception, "PyCurl: HTTP error %d -- %r" % (errcode,errmsg)
 
         # Parse response
         p, u = self.getparser()