mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Using custom splitting function for module param counting
This commit is contained in:
@@ -47,6 +47,7 @@ import connection
|
||||
from return_data import ReturnData
|
||||
from ansible.callbacks import DefaultRunnerCallbacks, vv
|
||||
from ansible.module_common import ModuleReplacer
|
||||
from ansible.module_utils.basic import split_args
|
||||
|
||||
module_replacer = ModuleReplacer(strip_comments=False)
|
||||
|
||||
@@ -397,14 +398,10 @@ class Runner(object):
|
||||
'''
|
||||
options = {}
|
||||
if args is not None:
|
||||
args = args.encode('utf-8')
|
||||
try:
|
||||
lexer = shlex.shlex(args)
|
||||
lexer.whitespace = '\t '
|
||||
lexer.whitespace_split = True
|
||||
vargs = [x.decode('utf-8') for x in lexer]
|
||||
except ValueError, ve:
|
||||
if 'no closing quotation' in str(ve).lower():
|
||||
vargs = split_args(args)
|
||||
except Exception, e:
|
||||
if "unbalanced jinja2 block or quotes" in str(e):
|
||||
raise errors.AnsibleError("error parsing argument string '%s', try quoting the entire line." % args)
|
||||
else:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user