Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into musicode
Browse files Browse the repository at this point in the history
  • Loading branch information
stanislavsulc committed Dec 15, 2023
2 parents b247632 + 4e8db2a commit f3cd076
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 8 additions & 0 deletions mupifDB/restApiControl.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,14 @@ def scheduleExecution(execution_id):

def setExecutionParameter(execution_id, param, value, val_type="str"):
if api_type == 'granta':
if param == 'ExecutionLog':
url = RESTserver + 'executions/' + str(execution_id)
token = getAuthToken()
headers = {'content-type': 'application/json', 'charset': 'UTF-8', 'accept': 'application/json', 'Accept-Charset': 'UTF-8', 'Authorization': f'Bearer {token["access_token"]}'}
newdata = {"logs": {"url": "https://musicode.grantami.com/musicode/filestore/%s" % str(value), "description": None}}
r = rPatch(url=url, headers=headers, data=json.dumps(newdata))
if r.status_code == 200:
return True
return None
response = rPatch(url=RESTserver + "executions/" + str(execution_id), data=json.dumps({"key": str(param), "value": value}))
return response.json()
Expand Down
9 changes: 0 additions & 9 deletions mupifDB/workflowscheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,6 @@ def updateStatPersistent (schedulerStat):
def copyLogToDB (we_id, workflowLogName):
try:
log.info("Copying log files to database")
# if os.path.exists(tempDir+'/mupif.log'):
# temp
with open(workflowLogName, 'rb') as f:
d = f.read()
f.close()
f = open('./temp_log.log', 'wb')
f.write(d)
f.close()

with open(workflowLogName, 'rb') as f:
logID = restApiControl.uploadBinaryFile(f)
if logID is not None:
Expand Down

0 comments on commit f3cd076

Please sign in to comment.