From 515fe111d983e1753fd935df4b54505f5f21b8fa Mon Sep 17 00:00:00 2001 From: Douglas Jacobsen Date: Mon, 6 Jan 2025 14:00:42 -0700 Subject: [PATCH] Update variable modifications with separators This commit adds the separator argument to some variable modification definitions. This allows the prefix definitions to be removed from the modifiers. --- var/ramble/repos/builtin/modifiers/apptainer/modifier.py | 7 ++----- .../repos/builtin/modifiers/pyxis-enroot/modifier.py | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/var/ramble/repos/builtin/modifiers/apptainer/modifier.py b/var/ramble/repos/builtin/modifiers/apptainer/modifier.py index 3594d47bc..1ebc5d509 100644 --- a/var/ramble/repos/builtin/modifiers/apptainer/modifier.py +++ b/var/ramble/repos/builtin/modifiers/apptainer/modifier.py @@ -189,10 +189,6 @@ def extract_names(itr, name_set=set()): # Define container_mounts input_mounts = app_inst.expander.expand_var("{container_mounts}") - prefix = "" - if len(input_mounts) > 0: - prefix = "," - exp_mount = "{experiment_run_dir}:{experiment_run_dir}" expanded_exp_mount = app_inst.expander.expand_var(exp_mount) @@ -209,7 +205,8 @@ def extract_names(itr, name_set=set()): if add_mod: self.variable_modification( "container_mounts", - modification=prefix + exp_mount, + modification=exp_mount, + separator=",", method="append", mode=self._usage_mode, ) diff --git a/var/ramble/repos/builtin/modifiers/pyxis-enroot/modifier.py b/var/ramble/repos/builtin/modifiers/pyxis-enroot/modifier.py index c1fec7ffc..b978843ca 100644 --- a/var/ramble/repos/builtin/modifiers/pyxis-enroot/modifier.py +++ b/var/ramble/repos/builtin/modifiers/pyxis-enroot/modifier.py @@ -175,10 +175,6 @@ def extract_names(itr, name_set=set()): # Define container_mounts input_mounts = app_inst.expander.expand_var("{container_mounts}") - prefix = "" - if len(input_mounts) > 0: - prefix = "," - exp_mount = "{experiment_run_dir}:{experiment_run_dir}" expanded_exp_mount = app_inst.expander.expand_var(exp_mount) @@ -196,7 +192,8 @@ def extract_names(itr, name_set=set()): if add_mod: self.variable_modification( "container_mounts", - modification=prefix + exp_mount, + modification=exp_mount, + separator=",", method="append", mode=self._usage_mode, )