Skip to content

Commit

Permalink
fix envvar handling
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed Dec 8, 2023
1 parent 16ee9de commit c9d007b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snakemake_executor_plugin_azure_batch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def __post_init__(self):
self.pool_id = f"snakepool-{ts:s}"
self.job_id = f"snakejob-{ts:s}"

self.envvars = list(self.workflow.envvars) or []
self.envvars = self.workflow.spawned_job_args_factory.envvars()

# enable autoscale flag
self.az_batch_enable_autoscale = self.settings.autoscale
Expand Down Expand Up @@ -328,10 +328,10 @@ def run_job(self, job: JobExecutorInterface):
# with job_info being of type
# snakemake_interface_executor_plugins.executors.base.SubmittedJobInfo.
envsettings = []
for key in self.envvars:
for key, value in self.envvars.items():
try:
envsettings.append(
batchmodels.EnvironmentSetting(name=key, value=os.environ[key])
batchmodels.EnvironmentSetting(name=key, value=value)
)
except KeyError:
continue
Expand Down

0 comments on commit c9d007b

Please sign in to comment.