diff --git a/docs/further.md b/docs/further.md index bbf8b0f..516ab96 100644 --- a/docs/further.md +++ b/docs/further.md @@ -92,7 +92,7 @@ jobs: 30 executor: htcondor configfile: my_config.yaml shared-fs-usage: none -htcondor-job-dir: /path/to/MyHTCondorWorkflow/logs +htcondor-jobdir: /path/to/MyHTCondorWorkflow/logs default-resources: job_wrapper: "wrapper.sh" container_image: "runtime_container.sif" diff --git a/snakemake_executor_plugin_htcondor/__init__.py b/snakemake_executor_plugin_htcondor/__init__.py index a9b75fb..4a31837 100644 --- a/snakemake_executor_plugin_htcondor/__init__.py +++ b/snakemake_executor_plugin_htcondor/__init__.py @@ -212,12 +212,17 @@ def run_job(self, job: JobExecutorInterface): # Name the jobs in the queue something that tells us what the job is submit_dict["batch_name"] = f"{job.name}-{job.jobid}" + # Check any custom classads for key in job.resources.keys(): if key.startswith("classad_"): - classad_key = key.removeprefix("classad_") + "+" - submit_dict[classad_key] = job.resources.get(key) - + classad_key = "+" + key.removeprefix("classad_") + value = job.resources.get(key) + # If the value is a string, HTCondor requires it to be quoted. + if isinstance(value, str): + submit_dict[classad_key] = f'"{value}"' + else: + submit_dict[classad_key] = value # HTCondor submit description self.logger.debug(f"HTCondor submit subscription: {submit_dict}") submit_description = htcondor.Submit(submit_dict)