summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2015-03-30 22:47:56 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2015-03-30 22:47:56 -0700
commit378dc561cbf15ededd5f20d88eb6e173953f4de7 (patch)
tree241d4ae19392b0e3c30094ff3e4e45cdafd3933b
parent43c1a9744765eebfb9eaf9113336d552cfc9096b (diff)
downloadansible-v2-parse_kv-newline.tar.gz
Possible fix for the first newline and triple newline problemsv2-parse_kv-newline
-rw-r--r--v2/ansible/parsing/splitter.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/v2/ansible/parsing/splitter.py b/v2/ansible/parsing/splitter.py
index 4af1c7b171..a1dc051d24 100644
--- a/v2/ansible/parsing/splitter.py
+++ b/v2/ansible/parsing/splitter.py
@@ -211,7 +211,7 @@ def split_args(args):
params.append(token)
appended = True
elif print_depth or block_depth or comment_depth or inside_quotes or was_inside_quotes:
- if idx == 0 and not inside_quotes and was_inside_quotes:
+ if idx == 0 and was_inside_quotes:
params[-1] = "%s%s" % (params[-1], token)
elif len(tokens) > 1:
spacer = ''
@@ -251,8 +251,7 @@ def split_args(args):
# one item (meaning we split on newlines), add a newline back here
# to preserve the original structure
if len(items) > 1 and itemidx != len(items) - 1 and not line_continuation:
- if not params[-1].endswith('\n'):
- params[-1] += '\n'
+ params[-1] += '\n'
# always clear the line continuation flag
line_continuation = False