Use repr to transfer JSON-arguments, so Python doesn't eat things

Fixes transferring newlines in args:, as well as """.
This commit is contained in:
Daniel Hokka Zakrisson 2013-02-27 17:16:23 +01:00
parent 0fc317de08
commit 1601f0b4d7

View file

@ -614,7 +614,7 @@ class Runner(object):
complex_args_json = utils.jsonify(complex_args) complex_args_json = utils.jsonify(complex_args)
encoded_args = "\"\"\"%s\"\"\"" % module_args.replace("\"","\\\"") encoded_args = "\"\"\"%s\"\"\"" % module_args.replace("\"","\\\"")
encoded_lang = "\"\"\"%s\"\"\"" % C.DEFAULT_MODULE_LANG 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, module_common.MODULE_COMMON)
module_data = module_data.replace(module_common.REPLACER_ARGS, encoded_args) module_data = module_data.replace(module_common.REPLACER_ARGS, encoded_args)