mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Enable UTF-8 commands via the raw module
Paramiko does not allow Unicode strings as parameters, so encode the command to UTF-8. Test case: ansible localhost -m raw -a 'echo ą' (also tested on local and ssh transports without problems)
This commit is contained in:
committed by
Michael DeHaan
parent
2aef0335cb
commit
73b0dd4ac0
@@ -212,7 +212,7 @@ class Runner(object):
|
|||||||
def _execute_raw(self, conn, tmp, inject=None):
|
def _execute_raw(self, conn, tmp, inject=None):
|
||||||
''' execute a non-module command for bootstrapping, or if there's no python on a device '''
|
''' execute a non-module command for bootstrapping, or if there's no python on a device '''
|
||||||
return ReturnData(conn=conn, result=dict(
|
return ReturnData(conn=conn, result=dict(
|
||||||
stdout=self._low_level_exec_command(conn, self.module_args, tmp, sudoable = True)
|
stdout=self._low_level_exec_command(conn, self.module_args.encode('utf-8'), tmp, sudoable = True)
|
||||||
))
|
))
|
||||||
|
|
||||||
# ***************************************************
|
# ***************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user