Skip to content

Commit

Permalink
Update variable modifications with separators
Browse files Browse the repository at this point in the history
This commit adds the separator argument to some variable modification
definitions. This allows the prefix definitions to be removed from the
modifiers.
  • Loading branch information
douglasjacobsen committed Jan 6, 2025
1 parent fb3380f commit 515fe11
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions var/ramble/repos/builtin/modifiers/apptainer/modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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,
)
Expand Down
7 changes: 2 additions & 5 deletions var/ramble/repos/builtin/modifiers/pyxis-enroot/modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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,
)
Expand Down

0 comments on commit 515fe11

Please sign in to comment.