From ce47455b0f2045f6fb1aa2da44263172e580a903 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Wed, 26 Apr 2023 09:41:50 +0200 Subject: [PATCH] fix: check for non-empty loop_type in CheckDeprecatedBareVars (#591) --- ansiblelater/rules/CheckDeprecatedBareVars.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ansiblelater/rules/CheckDeprecatedBareVars.py b/ansiblelater/rules/CheckDeprecatedBareVars.py index f3049e8..63ef59d 100644 --- a/ansiblelater/rules/CheckDeprecatedBareVars.py +++ b/ansiblelater/rules/CheckDeprecatedBareVars.py @@ -42,6 +42,9 @@ class CheckDeprecatedBareVars(StandardBase): for task in tasks: loop_type = next((key for key in task if key.startswith("with_")), None) + if not loop_type: + continue + if loop_type in [ "with_items", "with_nested",