mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #7535/af5da7d4 backport][stable-7] fix(modules/terraform): handle multiline strings correctly in complex variables (#7598)
fix(modules/terraform): handle multiline strings correctly in complex variables (#7535)
(cherry picked from commit af5da7d412
)
Co-authored-by: Yann Soubeyrand <github@yann.soubeyrand.eu>
This commit is contained in:
parent
f34cd9ddb9
commit
67279e7ca1
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "terraform - fix multiline string handling in complex variables (https://github.com/ansible-collections/community.general/pull/7535)."
|
|
@ -514,7 +514,7 @@ def main():
|
||||||
|
|
||||||
def format_args(vars):
|
def format_args(vars):
|
||||||
if isinstance(vars, str):
|
if isinstance(vars, str):
|
||||||
return '"{string}"'.format(string=vars.replace('\\', '\\\\').replace('"', '\\"'))
|
return '"{string}"'.format(string=vars.replace('\\', '\\\\').replace('"', '\\"')).replace('\n', '\\n')
|
||||||
elif isinstance(vars, bool):
|
elif isinstance(vars, bool):
|
||||||
if vars:
|
if vars:
|
||||||
return 'true'
|
return 'true'
|
||||||
|
|
Loading…
Reference in a new issue