summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2021-07-03 12:07:26 -0700
committerPeter Scheibel <scheibel1@llnl.gov>2021-10-28 15:37:44 -0700
commit374e3465c5efe6cc794141967885be2824f8e10a (patch)
tree61d045f3c218ee0815a5ed5ea4afa945259fee54 /lib
parent2bd513d6591161d271221bb76bc1420bd3c2b3e3 (diff)
downloadspack-374e3465c5efe6cc794141967885be2824f8e10a.tar.gz
spack-374e3465c5efe6cc794141967885be2824f8e10a.tar.bz2
spack-374e3465c5efe6cc794141967885be2824f8e10a.tar.xz
spack-374e3465c5efe6cc794141967885be2824f8e10a.zip
bugfix: `spack config get <section>` in environments
`spack config get <section>` was erroneously returning just the `spack.yaml` for the environment. It should return the combined configuration for that section (including anything from `spack.yaml`), even in an environment. - [x] reorder conditions in `cmd/config.py` to fix
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/config.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/config.py b/lib/spack/spack/cmd/config.py
index 2fc57a52c5..2dc25353ed 100644
--- a/lib/spack/spack/cmd/config.py
+++ b/lib/spack/spack/cmd/config.py
@@ -143,7 +143,10 @@ def config_get(args):
"""
scope, section = _get_scope_and_section(args)
- if scope and scope.startswith('env:'):
+ if section is not None:
+ spack.config.config.print_section(section)
+
+ elif scope and scope.startswith('env:'):
config_file = spack.config.config.get_config_filename(scope, section)
if os.path.exists(config_file):
with open(config_file) as f:
@@ -151,9 +154,6 @@ def config_get(args):
else:
tty.die('environment has no %s file' % ev.manifest_name)
- elif section is not None:
- spack.config.config.print_section(section)
-
else:
tty.die('`spack config get` requires a section argument '
'or an active environment.')