From 1601f0b4d78620c8dc10e168c379128bcc2ed7bc Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Wed, 27 Feb 2013 17:16:23 +0100 Subject: [PATCH] Use repr to transfer JSON-arguments, so Python doesn't eat things Fixes transferring newlines in args:, as well as """. --- lib/ansible/runner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index b3517e6a3fd..91272e5417c 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -614,7 +614,7 @@ class Runner(object): complex_args_json = utils.jsonify(complex_args) encoded_args = "\"\"\"%s\"\"\"" % module_args.replace("\"","\\\"") encoded_lang = "\"\"\"%s\"\"\"" % C.DEFAULT_MODULE_LANG - encoded_complex = "\"\"\"%s\"\"\"" % complex_args_json + encoded_complex = "%r" % complex_args_json module_data = module_data.replace(module_common.REPLACER, module_common.MODULE_COMMON) module_data = module_data.replace(module_common.REPLACER_ARGS, encoded_args)