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.
This commit is contained in:
parent
c595883195
commit
9957093e53
@ -35,7 +35,8 @@ def module(*args):
|
|||||||
module_p = subprocess.Popen(module_cmd,
|
module_p = subprocess.Popen(module_cmd,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
shell=True)
|
shell=True,
|
||||||
|
executable="/bin/bash")
|
||||||
|
|
||||||
# Cray modules spit out warnings that we cannot supress.
|
# Cray modules spit out warnings that we cannot supress.
|
||||||
# This hack skips to the last output (the environment)
|
# This hack skips to the last output (the environment)
|
||||||
@ -51,7 +52,8 @@ def module(*args):
|
|||||||
module_p = subprocess.Popen(module_cmd,
|
module_p = subprocess.Popen(module_cmd,
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.STDOUT,
|
stderr=subprocess.STDOUT,
|
||||||
shell=True)
|
shell=True,
|
||||||
|
executable="/bin/bash")
|
||||||
# Decode and str to return a string object in both python 2 and 3
|
# Decode and str to return a string object in both python 2 and 3
|
||||||
return str(module_p.communicate()[0].decode())
|
return str(module_p.communicate()[0].decode())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user