From ea997a68a436762151deb0f39ad1bfd98eff677a Mon Sep 17 00:00:00 2001 From: fbarreir Date: Mon, 4 Nov 2024 13:02:21 +0100 Subject: [PATCH] Fixing the log upload --- pandaserver/userinterface/Client.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pandaserver/userinterface/Client.py b/pandaserver/userinterface/Client.py index 12e06b1c..03f1cfc2 100755 --- a/pandaserver/userinterface/Client.py +++ b/pandaserver/userinterface/Client.py @@ -9,6 +9,7 @@ import socket import sys import tempfile +from cgi import logfile import requests from pandacommon.pandautils.net_utils import replace_hostname_in_url_randomly @@ -931,11 +932,12 @@ def uploadLog(logStr, logFileName): gfh.close() # execute url = f"{baseURLSSL}/uploadLog" - # sometimes the logFileName comes as an integer (e.g. a JEDI task ID) and it needs to be converted to a string - data = {"file": (str(logFileName), fh.name)} - retVal = http_client.post_files(url, data) + # sometimes the destination file name (=logFileName) comes as an integer (e.g. a JEDI task ID) and it needs to be converted to a string + logFileName = str(logFileName) + data = {"file": (logFileName, fh.name)} + return_value = http_client.post_files(url, data) os.unlink(fh.name) - return retVal + return return_value def changeTaskPriority(jediTaskID, newPriority):