mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #13774 from sivel/want-json-fix
Restore ability for a module to specify WANT_JSON
This commit is contained in:
commit
68d4c3bf3b
1 changed files with 3 additions and 1 deletions
|
@ -397,7 +397,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||||
if tmp:
|
if tmp:
|
||||||
remote_module_filename = self._connection._shell.get_remote_filename(module_name)
|
remote_module_filename = self._connection._shell.get_remote_filename(module_name)
|
||||||
remote_module_path = self._connection._shell.join_path(tmp, remote_module_filename)
|
remote_module_path = self._connection._shell.join_path(tmp, remote_module_filename)
|
||||||
if module_style == 'old':
|
if module_style in ['old', 'non_native_want_json']:
|
||||||
# we'll also need a temp file to hold our module arguments
|
# we'll also need a temp file to hold our module arguments
|
||||||
args_file_path = self._connection._shell.join_path(tmp, 'args')
|
args_file_path = self._connection._shell.join_path(tmp, 'args')
|
||||||
|
|
||||||
|
@ -411,6 +411,8 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||||
for k,v in iteritems(module_args):
|
for k,v in iteritems(module_args):
|
||||||
args_data += '%s="%s" ' % (k, pipes.quote(text_type(v)))
|
args_data += '%s="%s" ' % (k, pipes.quote(text_type(v)))
|
||||||
self._transfer_data(args_file_path, args_data)
|
self._transfer_data(args_file_path, args_data)
|
||||||
|
elif module_style == 'non_native_want_json':
|
||||||
|
self._transfer_data(args_file_path, json.dumps(module_args))
|
||||||
display.debug("done transferring module to remote")
|
display.debug("done transferring module to remote")
|
||||||
|
|
||||||
environment_string = self._compute_environment_string()
|
environment_string = self._compute_environment_string()
|
||||||
|
|
Loading…
Reference in a new issue