diff options
author | Matthew LeGendre <legendre1@llnl.gov> | 2015-10-02 11:00:41 -0700 |
---|---|---|
committer | Matthew LeGendre <legendre1@llnl.gov> | 2015-10-05 11:37:36 -0700 |
commit | e4d2ba30b57618da388a1a990381d149b33d7aba (patch) | |
tree | cee0e1a8399b84f37d0e72e2d28a418176b619b1 /lib | |
parent | 650c9d4e36c6a58cf6bca0e6abd580ee54d8e175 (diff) | |
download | spack-e4d2ba30b57618da388a1a990381d149b33d7aba.tar.gz spack-e4d2ba30b57618da388a1a990381d149b33d7aba.tar.bz2 spack-e4d2ba30b57618da388a1a990381d149b33d7aba.tar.xz spack-e4d2ba30b57618da388a1a990381d149b33d7aba.zip |
Fix failure in spack.test.config.ConfigTest from incorrect compiler config merging
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/config.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py index 60577c45b3..712a2b78fc 100644 --- a/lib/spack/spack/config.py +++ b/lib/spack/spack/config.py @@ -174,8 +174,12 @@ def _merge_dicts(d1, d2): for key2, val2 in d2.iteritems(): if not key2 in d1: d1[key2] = val2 - else: + elif type(d1[key2]) is dict and type(val2) is dict: d1[key2] = _merge_dicts(d1[key2], val2) + elif (type(d1) is list) and (type(d2) is list): + d1.extend(d2) + else: + d1[key2] = val2 return d1 return d2 @@ -360,7 +364,7 @@ def add_to_mirror_config(addition_dict, scope=None): def add_to_compiler_config(addition_dict, scope=None, arch=None): - """Add compilerss to the configuration files""" + """Add compilers to the configuration files""" if not arch: arch = spack.architecture.sys_type() add_to_config('compilers', { arch : addition_dict }, scope) |