From c5bcb7f823043581995aaa4bcd7138bff84a582d Mon Sep 17 00:00:00 2001 From: CamDavidsonPilon Date: Wed, 14 Aug 2024 22:37:56 -0400 Subject: [PATCH] str fallback --- pioreactor/actions/leader/experiment_profile.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pioreactor/actions/leader/experiment_profile.py b/pioreactor/actions/leader/experiment_profile.py index af10ef1b..9418494f 100644 --- a/pioreactor/actions/leader/experiment_profile.py +++ b/pioreactor/actions/leader/experiment_profile.py @@ -342,6 +342,7 @@ def _callable() -> None: if (get_assigned_experiment_name(unit) != experiment) and not is_testing_env(): return + nonlocal env env = env | {"hours_elapsed": seconds_to_hours(elapsed_seconds_func())} if (if_ is None) or evaluate_bool_expression(if_, env): @@ -415,6 +416,7 @@ def _callable() -> None: if get_assigned_experiment_name(unit) != experiment: return + nonlocal env env = env | {"hours_elapsed": seconds_to_hours(elapsed_seconds_func())} if ((if_ is None) or evaluate_bool_expression(if_, env)) and ( @@ -496,6 +498,7 @@ def _callable() -> None: if get_assigned_experiment_name(unit) != experiment: return + nonlocal env env = env | {"hours_elapsed": seconds_to_hours(elapsed_seconds_func())} if (if_ is None) or evaluate_bool_expression(if_, env): @@ -524,6 +527,8 @@ def _callable() -> None: # first check if the Pioreactor is still part of the experiment. if get_assigned_experiment_name(unit) != experiment: return + + nonlocal env env = env | {"hours_elapsed": seconds_to_hours(elapsed_seconds_func())} if (if_ is None) or evaluate_bool_expression(if_, env): @@ -561,6 +566,7 @@ def _callable() -> None: if get_assigned_experiment_name(unit) != experiment: return + nonlocal env env = env | {"hours_elapsed": seconds_to_hours(elapsed_seconds_func())} if (if_ is None) or evaluate_bool_expression(if_, env): @@ -590,6 +596,7 @@ def _callable() -> None: if get_assigned_experiment_name(unit) != experiment: return + nonlocal env env = env | {"hours_elapsed": seconds_to_hours(elapsed_seconds_func())} if (if_ is None) or evaluate_bool_expression(if_, env): @@ -619,6 +626,7 @@ def _callable() -> None: if get_assigned_experiment_name(unit) != experiment: return + nonlocal env env = env | {"hours_elapsed": seconds_to_hours(elapsed_seconds_func())} if (if_ is None) or evaluate_bool_expression(if_, env): @@ -649,6 +657,7 @@ def _callable() -> None: if get_assigned_experiment_name(unit) != experiment: return + nonlocal env env = env | {"hours_elapsed": seconds_to_hours(elapsed_seconds_func())} if (if_ is None) or evaluate_bool_expression(if_, env):