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
This commit is contained in:
parent
2bd513d659
commit
374e3465c5
@ -143,7 +143,10 @@ def config_get(args):
|
|||||||
"""
|
"""
|
||||||
scope, section = _get_scope_and_section(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)
|
config_file = spack.config.config.get_config_filename(scope, section)
|
||||||
if os.path.exists(config_file):
|
if os.path.exists(config_file):
|
||||||
with open(config_file) as f:
|
with open(config_file) as f:
|
||||||
@ -151,9 +154,6 @@ def config_get(args):
|
|||||||
else:
|
else:
|
||||||
tty.die('environment has no %s file' % ev.manifest_name)
|
tty.die('environment has no %s file' % ev.manifest_name)
|
||||||
|
|
||||||
elif section is not None:
|
|
||||||
spack.config.config.print_section(section)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
tty.die('`spack config get` requires a section argument '
|
tty.die('`spack config get` requires a section argument '
|
||||||
'or an active environment.')
|
'or an active environment.')
|
||||||
|
Loading…
Reference in New Issue
Block a user