From 73b0dd4ac0d7d6b27e2ddfe35fe262cdf934e334 Mon Sep 17 00:00:00 2001 From: Grzegorz Nosek Date: Mon, 20 Aug 2012 21:03:39 +0200 Subject: [PATCH] Enable UTF-8 commands via the raw module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- lib/ansible/runner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 39811bf119..6b7503aa49 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -212,7 +212,7 @@ class Runner(object): def _execute_raw(self, conn, tmp, inject=None): ''' execute a non-module command for bootstrapping, or if there's no python on a device ''' 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) )) # ***************************************************