Skip to content
Snippets Groups Projects
Commit 0522a867 authored by Charlotte Hausman's avatar Charlotte Hausman
Browse files

catch pass/fail case when request has mutable version

parent 22382fe6
No related branches found
No related tags found
2 merge requests!1006catch qa fail case when request has mutable version,!1005fix pass/fail with mutable version bug
......@@ -539,15 +539,23 @@ class QaPass(Action):
@staticmethod
def check_still_running(version: CapabilityVersion) -> bool:
workflow_service_url = CapoConfig().settings(WORKFLOW_SETTINGS_KEY).serviceUrl
if version.current_execution.current_workflow_request_id:
response = requests.get(
f"{workflow_service_url}/workflows/{version.capability.name}/requests/"
f"{version.current_execution.current_workflow_request_id}/htcondor_id"
)
if json.loads(response.content.decode())["htcondor_job_id"] == "None":
# check for execution
if version.current_execution:
# version is submitted, check for workflow
if version.current_execution.current_workflow_request_id:
response = requests.get(
f"{workflow_service_url}/workflows/{version.capability.name}/requests/"
f"{version.current_execution.current_workflow_request_id}/htcondor_id"
)
if json.loads(response.content.decode())["htcondor_job_id"] == "None":
# not running in HTCondor
return False
return True
else:
# workflow not submitted
return False
return True
else:
# version is not submitted
return False
@staticmethod
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment