1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #4269 from jphalip/issue-4256

In the script action: Get around a Python bug.
This commit is contained in:
jctanner 2013-09-30 20:24:49 -07:00
commit 32a1dd422c

View file

@ -36,7 +36,11 @@ class ActionModule(object):
# in check mode, always skip this module # in check mode, always skip this module
return ReturnData(conn=conn, comm_ok=True, result=dict(skipped=True, msg='check mode not supported for this module')) return ReturnData(conn=conn, comm_ok=True, result=dict(skipped=True, msg='check mode not supported for this module'))
tokens = shlex.split(module_args) # Decode the result of shlex.split() to UTF8 to get around a bug in that's been fixed in Python 2.7 but not Python 2.6.
# See: http://bugs.python.org/issue6988
tokens = shlex.split(module_args.encode('utf8'))
tokens = [s.decode('utf8') for s in tokens]
source = tokens[0] source = tokens[0]
# FIXME: error handling # FIXME: error handling
args = " ".join(tokens[1:]) args = " ".join(tokens[1:])