From 7b641ead1adcbcf6c6ab17caf514294bdbeb98af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A9ri=20Le=20Bouder?= Date: Mon, 28 Mar 2022 04:40:56 -0400 Subject: [PATCH] aws_s3: simplify the template check (#740) aws_s3: simplify the template check Don't compare strings with \n character. This triggers errors like this: fatal: [testhost]: FAILED! => { "msg": "The conditional check 'result.contents == \"template:\ntest template\n\"' failed. The error was: Invalid conditional detected: EOL while scanning string literal (, line 1)" } Reviewed-by: Alina Buzachis (cherry picked from commit d3e81b791dce7f9e09c9475ddbaec89382daf859) --- tests/integration/targets/aws_s3/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/targets/aws_s3/tasks/main.yml b/tests/integration/targets/aws_s3/tasks/main.yml index a36c659d4ef..ec69fa25062 100644 --- a/tests/integration/targets/aws_s3/tasks/main.yml +++ b/tests/integration/targets/aws_s3/tasks/main.yml @@ -666,7 +666,7 @@ bucket: "{{ bucket_name }}" object: put-template.txt mode: put - content: "{{ lookup('template', 'templates/put-template.txt.j2') }}" + content: "{{ lookup('template', 'templates/put-template.txt.j2')|replace('\n', '') }}" register: result - assert: @@ -682,7 +682,7 @@ - assert: that: - - result.contents == "{{ lookup('template', 'templates/put-template.txt.j2') }}" + - result.contents == "template:test template" # at present, there is no lookup that can process binary data, so we use slurp instead - slurp: