From 645a7dc14cffb99279171bacc9a7d0dfdfa2f8d6 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 30 Nov 2021 14:59:55 +0100 Subject: [PATCH] spack audit: fix API calls (#27713) This broke in #24858 --- lib/spack/spack/audit.py | 8 ++++---- 1 file 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)