From f2713f764c928dda10efd49b9dddbf5654ed686f Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Mon, 28 Mar 2016 15:43:43 -0400 Subject: [PATCH] Take previous jinja2 blocks into account in splitter when we see quotes Previously, split_args() was not taking print/block/comment depth into account when splitting things, meaning that if there was a quote character inside an un-quoted variable (ie. {{ foo | some_filter(' ') }}), it was incorrectly splitting on the quotes instead of continuing to append to the previous param. Fixes #13630 --- lib/ansible/parsing/splitter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/parsing/splitter.py b/lib/ansible/parsing/splitter.py index ed5ea55e818..4849d082658 100644 --- a/lib/ansible/parsing/splitter.py +++ b/lib/ansible/parsing/splitter.py @@ -204,7 +204,7 @@ def split_args(args): # to the end of the list, since we'll tack on more to it later # otherwise, if we're inside any jinja2 block, inside quotes, or we were # inside quotes (but aren't now) concat this token to the last param - if inside_quotes and not was_inside_quotes: + if inside_quotes and not was_inside_quotes and not(print_depth or block_depth or comment_depth): params.append(token) appended = True elif print_depth or block_depth or comment_depth or inside_quotes or was_inside_quotes: