summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2019-08-13 11:09:40 -0700
committerGitHub <noreply@github.com>2019-08-13 11:09:40 -0700
commit1f6befabb17b26b7c7d62d720bd34dc23e1bde3c (patch)
tree73cbd057be4bfe269dd1eb04dc9546249123168e
parent95fec7adfcfc7c027dc69ff30eb8a20c7c917696 (diff)
downloadspack-1f6befabb17b26b7c7d62d720bd34dc23e1bde3c.tar.gz
spack-1f6befabb17b26b7c7d62d720bd34dc23e1bde3c.tar.bz2
spack-1f6befabb17b26b7c7d62d720bd34dc23e1bde3c.tar.xz
spack-1f6befabb17b26b7c7d62d720bd34dc23e1bde3c.zip
Fix "spack loads" when retrieving upstream modules (#12203)
Fixes #12062 406c791 addressed "spack module load" for upstream modules but not the "spack module loads" command. This applies the same fixes from 406c791 to "spack module loads".
-rw-r--r--lib/spack/spack/cmd/modules/__init__.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/spack/spack/cmd/modules/__init__.py b/lib/spack/spack/cmd/modules/__init__.py
index c0f64b2c9d..33367f6c88 100644
--- a/lib/spack/spack/cmd/modules/__init__.py
+++ b/lib/spack/spack/cmd/modules/__init__.py
@@ -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 ',