summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGregory Becker <becker33@llnl.gov>2016-05-26 13:17:01 -0700
committerGregory Becker <becker33@llnl.gov>2016-05-26 13:17:01 -0700
commit189e8b3f349c8102772fa995fd8ee79df3c242c0 (patch)
treee6fed69047f56f951ca350978c9060c75142fcec /lib
parent88bec814eb45ff4997229e092f234d8ce7c76664 (diff)
downloadspack-189e8b3f349c8102772fa995fd8ee79df3c242c0.tar.gz
spack-189e8b3f349c8102772fa995fd8ee79df3c242c0.tar.bz2
spack-189e8b3f349c8102772fa995fd8ee79df3c242c0.tar.xz
spack-189e8b3f349c8102772fa995fd8ee79df3c242c0.zip
fixed compiler config init logic
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/__init__.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py
index 8fe7a17116..ea79f655b0 100644
--- a/lib/spack/spack/compilers/__init__.py
+++ b/lib/spack/spack/compilers/__init__.py
@@ -102,15 +102,18 @@ def get_compiler_config(scope=None):
# configured. Avoid updating automatically if there ARE site
# compilers configured but no user ones.
# if (isinstance(arch, basestring) or arch == my_arch) and arch not in config:
- if scope is None:
- # We know no compilers were configured in any scope.
- init_compiler_config()
- elif scope == 'user':
- # Check the site config and update the user config if
- # nothing is configured at the site level.
- site_config = spack.config.get_config('compilers', scope='site')
- if not site_config:
+ if not config:
+ if scope is None:
+ # We know no compilers were configured in any scope.
init_compiler_config()
+ config = spack.config.get_config('compilers', scope=scope)
+ elif scope == 'user':
+ # Check the site config and update the user config if
+ # nothing is configured at the site level.
+ site_config = spack.config.get_config('compilers', scope='site')
+ if not site_config:
+ init_compiler_config()
+ config = spack.config.get_config('compilers', scope=scope)
return config