diff options
author | becker33 <becker33@llnl.gov> | 2017-08-09 12:14:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-09 12:14:35 -0700 |
commit | 79f9548a9ad31a901fae1296e31c6b8d184cdc0e (patch) | |
tree | ea7d33f4b9392f3c1bc3c530defe7dad127c3e34 | |
parent | faeb1b77b2a5c5188b0d765c337c342dc2b8fd35 (diff) | |
download | spack-79f9548a9ad31a901fae1296e31c6b8d184cdc0e.tar.gz spack-79f9548a9ad31a901fae1296e31c6b8d184cdc0e.tar.bz2 spack-79f9548a9ad31a901fae1296e31c6b8d184cdc0e.tar.xz spack-79f9548a9ad31a901fae1296e31c6b8d184cdc0e.zip |
bugfix for module_cmd (#5038)
* bugfix for modulecmd when bash is symlinked to sh
* update test to make sure module_cmd can interpret sh
-rw-r--r-- | lib/spack/spack/test/module_parsing.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/util/module_cmd.py | 2 |
2 files changed, 2 insertions, 2 deletions
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: |