uploading bmlog - fits new pycurl
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 8 Jan 2010 14:18:08 +0000 (14:18 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Fri, 8 Jan 2010 14:18:08 +0000 (14:18 +0000)
source/BootManager.py

index 714aa15..cdd2cfa 100755 (executable)
@@ -124,11 +124,24 @@ class log:
             hostname= self.VARS['INTERFACE_SETTINGS']['hostname'] + "." + \
                       self.VARS['INTERFACE_SETTINGS']['domainname']
             bs_request = BootServerRequest.BootServerRequest(self.VARS)
-            bs_request.MakeRequest(PartialPath = self.VARS['UPLOAD_LOG_SCRIPT'],
-                                   GetVars = None, PostVars = None,
-                                   FormData = ["log=@" + self.OutputFilePath,
-                                   "hostname=" + hostname, "type=bm.log"],
-                                   DoSSL = True, DoCertCheck = True)
+            try:
+                # this was working until f10
+                bs_request.MakeRequest(PartialPath = self.VARS['UPLOAD_LOG_SCRIPT'],
+                                       GetVars = None, PostVars = None,
+                                       DoSSL = True, DoCertCheck = True,
+                                       FormData = ["log=@" + self.OutputFilePath,
+                                                   "hostname=" + hostname, 
+                                                   "type=bm.log"])
+            except:
+                # new pycurl
+                import pycurl
+                bs_request.MakeRequest(PartialPath = self.VARS['UPLOAD_LOG_SCRIPT'],
+                                       GetVars = None, PostVars = None,
+                                       DoSSL = True, DoCertCheck = True,
+                                       FormData = [('log',(pycurl.FORM_FILE, self.OutputFilePath)),
+                                                   ("hostname",hostname),
+                                                   ("type","bm.log")])
+
 
 ##############################
 class BootManager: