mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Catch a unquoted line error. Fixes #6532
This commit is contained in:
@@ -539,8 +539,14 @@ def parse_kv(args):
|
||||
if args is not None:
|
||||
# attempting to split a unicode here does bad things
|
||||
args = args.encode('utf-8')
|
||||
vargs = [x.decode('utf-8') for x in shlex.split(args, posix=True)]
|
||||
#vargs = shlex.split(str(args), posix=True)
|
||||
try:
|
||||
vargs = shlex.split(args, posix=True)
|
||||
except ValueError, ve:
|
||||
if 'no closing quotation' in str(ve).lower():
|
||||
raise errors.AnsibleError("error parsing argument string, try quoting the entire line.")
|
||||
else:
|
||||
raise
|
||||
vargs = [x.decode('utf-8') for x in vargs]
|
||||
for x in vargs:
|
||||
if "=" in x:
|
||||
k, v = x.split("=",1)
|
||||
|
||||
Reference in New Issue
Block a user