summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMario Melara <maamelara@gmail.com>2019-05-17 16:49:19 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2019-05-18 01:49:19 +0200
commit9957093e53f927462868538d0d8e5e5bc96c61d7 (patch)
treeae6551cac3d1bc9ca5d56fb7a44dd3c5fd143d28 /lib
parentc595883195336e9a6feb76e5ea278c87c5ed23ef (diff)
downloadspack-9957093e53f927462868538d0d8e5e5bc96c61d7.tar.gz
spack-9957093e53f927462868538d0d8e5e5bc96c61d7.tar.bz2
spack-9957093e53f927462868538d0d8e5e5bc96c61d7.tar.xz
spack-9957093e53f927462868538d0d8e5e5bc96c61d7.zip
Execute modulecmd in bash shell (#11510)
Adds executable=/bin/bash into Popen. We discovered this bug while working in a csh/tsch environment. By executing with /bin/bash we ensure that the module command works.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/util/module_cmd.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/spack/spack/util/module_cmd.py b/lib/spack/spack/util/module_cmd.py
index a7796e716e..581fae5540 100644
--- a/lib/spack/spack/util/module_cmd.py
+++ b/lib/spack/spack/util/module_cmd.py
@@ -35,7 +35,8 @@ def module(*args):
module_p = subprocess.Popen(module_cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
- shell=True)
+ shell=True,
+ executable="/bin/bash")
# Cray modules spit out warnings that we cannot supress.
# This hack skips to the last output (the environment)
@@ -51,7 +52,8 @@ def module(*args):
module_p = subprocess.Popen(module_cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
- shell=True)
+ shell=True,
+ executable="/bin/bash")
# Decode and str to return a string object in both python 2 and 3
return str(module_p.communicate()[0].decode())