From 32f7e7c37a21f1f46aceed8daaee634860bf9ef1 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 19 May 2020 10:40:29 +0200 Subject: [PATCH] encode module arguments to fix comparison --- CHANGELOG.md | 4 ++-- ansiblelater/rules/yamlfiles.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39cfd4b..2266a74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,2 @@ -* INTERNAL - * maintenance and refactoring release, no changes +* BUGFIX + * encode module arguments to fix comparison diff --git a/ansiblelater/rules/yamlfiles.py b/ansiblelater/rules/yamlfiles.py index e001599..b968d47 100644 --- a/ansiblelater/rules/yamlfiles.py +++ b/ansiblelater/rules/yamlfiles.py @@ -35,7 +35,10 @@ def check_native_yaml(candidate, settings): break action = normal_form["action"]["__ansible_module__"] - arguments = normal_form["action"]["__ansible_arguments__"] + arguments = [ + bytes(x, "utf-8").decode("unicode_escape") + for x in normal_form["action"]["__ansible_arguments__"] + ] # Cope with `set_fact` where task["set_fact"] is None if not task.get(action): continue