diff options
author | Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> | 2022-08-11 05:09:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-11 14:09:53 +0200 |
commit | f96b54b0a63713d50f956abb4930d99ee37eb58e (patch) | |
tree | 1e69992af8a724f688a2ca88b2da9858f1d5c27a /lib | |
parent | 5e5767714062e0b90638f33e31059928432f9903 (diff) | |
download | spack-f96b54b0a63713d50f956abb4930d99ee37eb58e.tar.gz spack-f96b54b0a63713d50f956abb4930d99ee37eb58e.tar.bz2 spack-f96b54b0a63713d50f956abb4930d99ee37eb58e.tar.xz spack-f96b54b0a63713d50f956abb4930d99ee37eb58e.zip |
info: properly report default when for overridden variants (#32040)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/cmd/info.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py index 97417eed3a..ce69d98dbb 100644 --- a/lib/spack/spack/cmd/info.py +++ b/lib/spack/spack/cmd/info.py @@ -145,10 +145,8 @@ class VariantFormatter(object): name = textwrap.wrap( "{0} [{1}]".format(k, self.default(v)), width=self.column_widths[0] ) - if len(w) == 1: - w = w[0] - if w == spack.spec.Spec(): - w = "--" + if all(spec == spack.spec.Spec() for spec in w): + w = "--" when = textwrap.wrap(str(w), width=self.column_widths[1]) allowed = v.allowed_values.replace("True, False", "on, off") allowed = textwrap.wrap(allowed, width=self.column_widths[2]) |