From 612b446856caea4b966e301aac935b77dc25959d Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 14 Oct 2013 12:36:21 +0300 Subject: [PATCH] copy: Don't modify input module_args in a recursive file handling loop. --- lib/ansible/runner/action_plugins/copy.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ansible/runner/action_plugins/copy.py b/lib/ansible/runner/action_plugins/copy.py index f86c3464db..9f9da53496 100644 --- a/lib/ansible/runner/action_plugins/copy.py +++ b/lib/ansible/runner/action_plugins/copy.py @@ -189,8 +189,9 @@ class ActionModule(object): if raw: # don't send down raw=no module_args.pop('raw') - module_args = "%s src=%s original_basename=%s" % (module_args, pipes.quote(tmp_src), pipes.quote(source_rel)) - module_return = self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject, complex_args=complex_args) + + module_args_tmp = "%s src=%s original_basename=%s" % (module_args, pipes.quote(tmp_src), pipes.quote(source_rel)) + module_return = self.runner._execute_module(conn, tmp, 'copy', module_args_tmp, inject=inject, complex_args=complex_args) else: # no need to transfer the file, already correct md5, but still need to call @@ -206,10 +207,10 @@ class ActionModule(object): if raw: # don't send down raw=no module_args.pop('raw') - module_args = "%s src=%s" % (module_args, pipes.quote(tmp_src)) + module_args_tmp = "%s src=%s" % (module_args, pipes.quote(tmp_src)) if self.runner.noop_on_check(inject): - module_args = "%s CHECKMODE=True" % module_args - module_return = self.runner._execute_module(conn, tmp, 'file', module_args, inject=inject, complex_args=complex_args) + module_args_tmp = "%s CHECKMODE=True" % module_args_tmp + module_return = self.runner._execute_module(conn, tmp, 'file', module_args_tmp, inject=inject, complex_args=complex_args) module_result = module_return.result if module_result.get('failed') == True: