summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-11-30 14:59:55 +0100
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-12-23 16:02:09 +0100
commite9f7fb03c9f92e78637480cbda7e5ecdc3e28dda (patch)
tree5bd9f5121a47fb6b5fcbf8a59e69149832d490b2
parent9d4291e590b304164598f32f63a8afbd6a2f2ec0 (diff)
downloadspack-e9f7fb03c9f92e78637480cbda7e5ecdc3e28dda.tar.gz
spack-e9f7fb03c9f92e78637480cbda7e5ecdc3e28dda.tar.bz2
spack-e9f7fb03c9f92e78637480cbda7e5ecdc3e28dda.tar.xz
spack-e9f7fb03c9f92e78637480cbda7e5ecdc3e28dda.zip
spack audit: fix API calls (#27713)
This broke in #24858
-rw-r--r--lib/spack/spack/audit.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/audit.py b/lib/spack/spack/audit.py
index 47894383a5..f6ef90e0b8 100644
--- a/lib/spack/spack/audit.py
+++ b/lib/spack/spack/audit.py
@@ -389,9 +389,8 @@ def _unknown_variants_in_dependencies(pkgs, error_cls):
dependency_variants = dependency_edge.spec.variants
for name, value in dependency_variants.items():
try:
- dependency_pkg.variants[name].validate_or_raise(
- value, pkg=dependency_pkg
- )
+ v, _ = dependency_pkg.variants[name]
+ v.validate_or_raise(value, pkg=dependency_pkg)
except Exception as e:
summary = (pkg_name + ": wrong variant used for a "
"dependency in a 'depends_on' directive")
@@ -419,7 +418,8 @@ def _analyze_variants_in_directive(pkg, constraint, directive, error_cls):
errors = []
for name, v in constraint.variants.items():
try:
- pkg.variants[name].validate_or_raise(v, pkg=pkg)
+ variant, _ = pkg.variants[name]
+ variant.validate_or_raise(v, pkg=pkg)
except variant_exceptions as e:
summary = pkg.name + ': wrong variant in "{0}" directive'
summary = summary.format(directive)