Fix "spack loads" when retrieving upstream modules (#12203)
Fixes #12062406c791
addressed "spack module load" for upstream modules but not the "spack module loads" command. This applies the same fixes from406c791
to "spack module loads".
This commit is contained in:
parent
95fec7adfc
commit
1f6befabb1
@ -130,15 +130,9 @@ def loads(module_type, specs, args, out=sys.stdout):
|
||||
if not (item in seen or seen_add(item))]
|
||||
)
|
||||
|
||||
module_cls = spack.modules.module_types[module_type]
|
||||
modules = list()
|
||||
for spec in specs:
|
||||
if os.path.exists(module_cls(spec).layout.filename):
|
||||
modules.append((spec, module_cls(spec).layout.use_name))
|
||||
elif spec.package.installed_upstream:
|
||||
tty.debug("Using upstream module for {0}".format(spec))
|
||||
module = spack.modules.common.upstream_module(spec, module_type)
|
||||
modules.append((spec, module.use_name))
|
||||
modules = list(
|
||||
(spec, spack.modules.common.get_module(module_type, spec, False))
|
||||
for spec in specs)
|
||||
|
||||
module_commands = {
|
||||
'tcl': 'module load ',
|
||||
|
Loading…
Reference in New Issue
Block a user