Skip to content

Commit

Permalink
linting 2
Browse files Browse the repository at this point in the history
  • Loading branch information
jannisspeer committed Mar 23, 2024
1 parent 875078f commit 2a78644
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions snakemake_executor_plugin_htcondor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,51 +224,60 @@ async def check_active_jobs(
if job_status[0]["JobStatus"] in [1, 2, 6, 7]:
if job_status[0]["JobStatus"] in [7]:
self.logger.warning(
f"Job {current_job.job.jobid} with HTCondor Cluster ID "
f"Job {current_job.job.jobid} with "
"HTCondor Cluster ID "
f"{current_job.external_jobid} is suspended."
)
yield current_job
# Completed jobs
elif job_status[0]["JobStatus"] in [4]:
self.logger.debug(
f"Check whether Job {current_job.job.jobid} with HTCondor Cluster ID "
f"Check whether Job {current_job.job.jobid} with "
"HTCondor Cluster ID "
f"{current_job.external_jobid} was successful."
)
# Check ExitCode
if job_status[0]["ExitCode"] == 0:
# Job was successful
self.logger.debug(
f"Report Job {current_job.job.jobid} with HTCondor Cluster ID "
f"Report Job {current_job.job.jobid} with "
"HTCondor Cluster ID "
f"{current_job.external_jobid} success"
)
self.logger.info(
f"Job {current_job.job.jobid} with HTCondor Cluster ID "
f"Job {current_job.job.jobid} with "
"HTCondor Cluster ID "
f"{current_job.external_jobid} was successful."
)
self.report_job_success(current_job)
else:
self.logger.debug(
f"Report Job {current_job.job.jobid} with HTCondor Cluster ID "
f"Report Job {current_job.job.jobid} with "
"HTCondor Cluster ID "
f"{current_job.external_jobid} error"
)
self.report_job_error(
current_job,
msg=f"Job {current_job.job.jobid} with HTCondor Cluster ID "
msg=f"Job {current_job.job.jobid} with "
"HTCondor Cluster ID "
f"{current_job.external_jobid} has "
f" status {job_status[0]['JobStatus']} but failed with"
f" status {status_dict[str(job_status[0]['JobStatus'])]}, "
"but failed with"
f"ExitCode {job_status[0]['ExitCode']}.",
)
# Errored jobs
elif job_status[0]["JobStatus"] in [3, 5]:
self.report_job_error(
current_job,
msg=f"Job {current_job.job.jobid} with HTCondor Cluster ID "
msg=f"Job {current_job.job.jobid} with "
"HTCondor Cluster ID "
f"{current_job.external_jobid} has "
f"status {status_dict[str(job_status[0]['JobStatus'])]}.",
)
else:
raise WorkflowError(
f"Job {current_job.job.jobid} with HTCondor Cluster ID "
f"Job {current_job.job.jobid} with "
"HTCondor Cluster ID "
f"{current_job.external_jobid} has "
f"unknown HTCondor job status: {job_status[0]['JobStatus']}"
)
Expand Down

0 comments on commit 2a78644

Please sign in to comment.