From 79f9548a9ad31a901fae1296e31c6b8d184cdc0e Mon Sep 17 00:00:00 2001 From: becker33 Date: Wed, 9 Aug 2017 12:14:35 -0700 Subject: bugfix for module_cmd (#5038) * bugfix for modulecmd when bash is symlinked to sh * update test to make sure module_cmd can interpret sh --- lib/spack/spack/test/module_parsing.py | 2 +- lib/spack/spack/util/module_cmd.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/test/module_parsing.py b/lib/spack/spack/test/module_parsing.py index d306915834..e563953478 100644 --- a/lib/spack/spack/test/module_parsing.py +++ b/lib/spack/spack/test/module_parsing.py @@ -112,7 +112,7 @@ def test_get_module_cmd_from_bash_ticks(save_env): def test_get_module_cmd_from_bash_parens(save_env): - os.environ['BASH_FUNC_module()'] = '() { eval $(echo fill bash $*)\n}' + os.environ['BASH_FUNC_module()'] = '() { eval $(echo fill sh $*)\n}' module_cmd = get_module_cmd() module_cmd_list = module_cmd('list', output=str, error=str) diff --git a/lib/spack/spack/util/module_cmd.py b/lib/spack/spack/util/module_cmd.py index 4de3fb051e..87ccd79fd6 100644 --- a/lib/spack/spack/util/module_cmd.py +++ b/lib/spack/spack/util/module_cmd.py @@ -97,7 +97,7 @@ def get_module_cmd_from_bash(bashopts=''): module_cmd = which(args[0]) if module_cmd: for arg in args[1:]: - if arg == 'bash': + if arg in ('bash', 'sh'): module_cmd.add_default_arg('python') break else: -- cgit v1.2.3-70-g09d2