From edd5baad8b7d79c6e79be6f15a53ed9339ee32a3 Mon Sep 17 00:00:00 2001 From: Jeroen Hoekx Date: Wed, 4 Apr 2012 13:36:21 +0200 Subject: [PATCH] Refactor _transfer_argsfile to generic string transfer function. --- lib/ansible/runner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/runner.py b/lib/ansible/runner.py index 4e4fd25573..1a874a4afb 100755 --- a/lib/ansible/runner.py +++ b/lib/ansible/runner.py @@ -267,7 +267,7 @@ class Runner(object): # ***************************************************** - def _transfer_argsfile(self, conn, tmp, args_str): + def _transfer_str(self, conn, tmp, name, args_str): ''' transfer arguments as a single file to be fed to the module. ''' args_fd, args_file = tempfile.mkstemp() @@ -276,7 +276,7 @@ class Runner(object): args_fo.flush() args_fo.close() - args_remote = os.path.join(tmp, 'arguments') + args_remote = os.path.join(tmp, name) conn.put_file(args_file, args_remote) os.unlink(args_file) @@ -355,7 +355,7 @@ class Runner(object): module_name_tail = remote_module_path.split("/")[-1] client_executed_str = "%s %s" % (module_name_tail, args.strip()) - argsfile = self._transfer_argsfile(conn, tmp, args) + argsfile = self._transfer_str(conn, tmp, 'arguments', args) if async_jid is None: cmd = "%s %s" % (remote_module_path, argsfile) else: