Skip to content

Commit

Permalink
fix modules use on clariden
Browse files Browse the repository at this point in the history
  • Loading branch information
bcumming committed Oct 17, 2023
1 parent 7bcbd6f commit 6beb853
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions uenv-impl
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,17 @@ def generate_modules_command(args, env):
output.append(f"echo ' {name}:{mount}'")
output.append(shell_noop)
return output
# uenv modules use images[]
else:
images = args.image
mounts=[]
if len(images)>0:
# no images were specified, i.e. the user simpley requested:
# uenv modules use
# in which case the list of mounts is the mount points for all images
# that provide modules.
if len(images)==0:
mounts = [e["mount"] for e in module_envs]
else:
for i in images:
matches = [e.mount for e in env.uenvs
if (e.matches_name(i))
Expand All @@ -569,8 +576,6 @@ def generate_modules_command(args, env):
return shell_noop
print_debug(f" uenv {i} mounted at {matches[0]}")
mounts.append(matches[0])
else:
mounts = [e["mount"] for e in env.uenvs]

modulepaths = [str(p / 'modules') for p in mounts]
for p in modulepaths:
Expand Down

0 comments on commit 6beb853

Please sign in to comment.