mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 06:30:19 -07:00
Catch a unquoted line error. Fixes #6532
This commit is contained in:
parent
b8d5ba42f5
commit
94e3350b38
3 changed files with 10 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue