mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Escape args injected in new style modules
This commit is contained in:
parent
8f3b2b281f
commit
75ceb80572
4 changed files with 17 additions and 15 deletions
|
@ -85,10 +85,10 @@ def boilerplate_module(modfile, args):
|
|||
if included_boilerplate:
|
||||
|
||||
module_data = module_data.replace(module_common.REPLACER, module_common.MODULE_COMMON)
|
||||
encoded_args = "\"\"\"%s\"\"\"" % args.replace("\"","\\\"")
|
||||
encoded_args = repr(str(args))
|
||||
module_data = module_data.replace(module_common.REPLACER_ARGS, encoded_args)
|
||||
encoded_lang = "\"\"\"%s\"\"\"" % C.DEFAULT_MODULE_LANG
|
||||
empty_complex = "\"\"\"%s\"\"\"" % "{}"
|
||||
encoded_lang = repr(C.DEFAULT_MODULE_LANG)
|
||||
empty_complex = repr("{}")
|
||||
module_data = module_data.replace(module_common.REPLACER_LANG, encoded_lang)
|
||||
module_data = module_data.replace('syslog.LOG_USER', "syslog.%s" % C.DEFAULT_SYSLOG_FACILITY)
|
||||
module_data = module_data.replace(module_common.REPLACER_COMPLEX, empty_complex)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue