From 3afc6770f051415c26875df0ca521ab5c245fa99 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Sat, 21 Oct 2017 05:41:25 +0200 Subject: [PATCH] module-type argument defaults to 'tcl' instead of every known type (#5751) fixes #5721 This is to solve the fact that lmod needs to be configured by the user (to specify a core compiler). --- lib/spack/spack/cmd/common/arguments.py | 2 +- lib/spack/spack/cmd/module.py | 4 +++- lib/spack/spack/test/cmd/module.py | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/spack/spack/cmd/common/arguments.py b/lib/spack/spack/cmd/common/arguments.py index bb462580f1..9a185d2519 100644 --- a/lib/spack/spack/cmd/common/arguments.py +++ b/lib/spack/spack/cmd/common/arguments.py @@ -107,7 +107,7 @@ def __call__(self, parser, namespace, values, option_string=None): '-m', '--module-type', choices=spack.modules.module_types.keys(), action='append', - help='type of module file. More than one choice is allowed [default: all available module types]') # NOQA: ignore=E501 + help='type of module file. More than one choice is allowed [default: tcl]') # NOQA: ignore=E501 _arguments['yes_to_all'] = Args( '-y', '--yes-to-all', action='store_true', dest='yes_to_all', diff --git a/lib/spack/spack/cmd/module.py b/lib/spack/spack/cmd/module.py index 422ccdc196..8f18723633 100644 --- a/lib/spack/spack/cmd/module.py +++ b/lib/spack/spack/cmd/module.py @@ -332,7 +332,9 @@ def module(parser, args): module_types = args.module_type if module_types is None: # If no selection has been made select all of them - module_types = list(spack.modules.module_types.keys()) + module_types = ['tcl'] + + module_types = list(set(module_types)) try: diff --git a/lib/spack/spack/test/cmd/module.py b/lib/spack/spack/test/cmd/module.py index 2025953059..a64746125e 100644 --- a/lib/spack/spack/test/cmd/module.py +++ b/lib/spack/spack/test/cmd/module.py @@ -54,7 +54,8 @@ def parser(): ['rm', 'doesnotexist'], # Try to remove a non existing module ['find', 'mpileaks'], # Try to find a module with multiple matches ['find', 'doesnotexist'], # Try to find a module with no matches - ['find', 'libelf'], # Try to find a module wo specifying the type + # Try to find a module specifying more than one type + ['find', '-m', 'tcl', '-m', 'lmod', 'libelf'], ] ) def failure_args(request):