diff options
author | Mario Melara <maamelara@gmail.com> | 2017-01-05 11:15:38 -0800 |
---|---|---|
committer | becker33 <becker33@llnl.gov> | 2017-01-05 11:15:38 -0800 |
commit | 3d54c3c689ac17366325c5a48e8b94f667414f71 (patch) | |
tree | 0a39bdc755043b516adce5de716b9ad89d3f8eaa | |
parent | 9271c69b5d529d49e23ab93df6ccc5464e6bf39d (diff) | |
download | spack-3d54c3c689ac17366325c5a48e8b94f667414f71.tar.gz spack-3d54c3c689ac17366325c5a48e8b94f667414f71.tar.bz2 spack-3d54c3c689ac17366325c5a48e8b94f667414f71.tar.xz spack-3d54c3c689ac17366325c5a48e8b94f667414f71.zip |
Correct env vars for modulecmd; Fixes #1481 (#2745)
Don't override MODULEPATH with PATH, PATH has no modulefiles
PEP8 compliance
-rw-r--r-- | lib/spack/spack/operating_systems/cnl.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/spack/spack/operating_systems/cnl.py b/lib/spack/spack/operating_systems/cnl.py index 790090d9db..7acab1cbcb 100644 --- a/lib/spack/spack/operating_systems/cnl.py +++ b/lib/spack/spack/operating_systems/cnl.py @@ -23,7 +23,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## import re -import os from spack.architecture import OperatingSystem from spack.util.executable import * @@ -67,17 +66,10 @@ class Cnl(OperatingSystem): modulecmd = which('modulecmd') modulecmd.add_default_arg('python') - # Save the environment variable to restore later - old_modulepath = os.environ['MODULEPATH'] - # if given any explicit paths, search them for module files too - if paths: - module_paths = ':' + ':'.join(p for p in paths) - os.environ['MODULEPATH'] = module_paths - output = modulecmd( 'avail', cmp_cls.PrgEnv_compiler, output=str, error=str) - matches = re.findall( - r'(%s)/([\d\.]+[\d])' % cmp_cls.PrgEnv_compiler, output) + version_regex = r'(%s)/([\d\.]+[\d])' % cmp_cls.PrgEnv_compiler + matches = re.findall(version_regex, output) for name, version in matches: v = version comp = cmp_cls( @@ -87,8 +79,4 @@ class Cnl(OperatingSystem): compilers.append(comp) - # Restore modulepath environment variable - if paths: - os.environ['MODULEPATH'] = old_modulepath - return compilers |