Skip to content

Commit

Permalink
Fixing the log upload
Browse files Browse the repository at this point in the history
  • Loading branch information
fbarreir committed Nov 4, 2024
1 parent 07c9abd commit ea997a6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pandaserver/userinterface/Client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit ea997a6

Please sign in to comment.