From 11961ab2f5aa2501817a5a1651c293f91838b46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Mon, 18 Nov 2024 15:04:34 +0100 Subject: [PATCH] wip: inject step env into step execution env --- src/_ert/forward_model_runner/forward_model_step.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/_ert/forward_model_runner/forward_model_step.py b/src/_ert/forward_model_runner/forward_model_step.py index 0f4484fb06c..260890f5d75 100644 --- a/src/_ert/forward_model_runner/forward_model_step.py +++ b/src/_ert/forward_model_runner/forward_model_step.py @@ -145,9 +145,14 @@ def _open_file_handles( return (stdin, stdout, stderr) def _create_environment(self) -> Optional[Dict[str, str]]: - combined_environment = None + combined_environment: Optional[Dict[str, str]] = None if environment := self.job_data.get("environment"): combined_environment = {**os.environ, **environment} + if step_environment := self.job_data.get("env_pr_fm_step"): + if combined_environment is None: + combined_environment = {**os.environ, **step_environment} + else: + combined_environment = {**combined_environment, **step_environment} return combined_environment def _run(self) -> Generator[Start | Exited | Running | None]: