- bs_request = BootServerRequest.BootServerRequest()
- bs_request.MakeRequest(PartialPath = UPLOAD_LOG_SCRIPT,
- GetVars = None, PostVars = None,
- FormData = ["log=@" + self.OutputFilePath],
- DoSSL = True, DoCertCheck = True)
+ hostname= self.VARS['INTERFACE_SETTINGS']['hostname'] + "." + \
+ self.VARS['INTERFACE_SETTINGS']['domainname']
+ bs_request = BootServerRequest.BootServerRequest(self.VARS)
+ 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")])
+ if extra_file is not None:
+ # NOTE: for code-reuse, evoke the bash function 'upload_logs';
+ # by adding --login, bash reads .bash_profile before execution.
+ # Also, never fail, since this is an optional feature.
+ utils.sysexec_noerr( """bash --login -c "upload_logs %s" """ % extra_file, self)
+