From 374e3465c5efe6cc794141967885be2824f8e10a Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Sat, 3 Jul 2021 12:07:26 -0700 Subject: bugfix: `spack config get
` in environments `spack config get
` 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 --- lib/spack/spack/cmd/config.py | 8 ++++---- 1 file 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.') -- cgit v1.2.3-70-g09d2