From e304cc3d8e7f5fa020665479c285948f90f36393 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 11 Mar 2013 17:13:59 -0400 Subject: [PATCH] Simple fix for spaces in filenames with the template module. --- lib/ansible/runner/action_plugins/template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner/action_plugins/template.py b/lib/ansible/runner/action_plugins/template.py index 7c137839c31..a4c9bdd4abd 100644 --- a/lib/ansible/runner/action_plugins/template.py +++ b/lib/ansible/runner/action_plugins/template.py @@ -16,7 +16,7 @@ # along with Ansible. If not, see . import os - +import pipes from ansible import utils from ansible import errors from ansible.runner.return_data import ReturnData @@ -105,7 +105,7 @@ class ActionModule(object): self.runner._low_level_exec_command(conn, "chmod a+r %s" % xfered, tmp) # run the copy module - module_args = "%s src=%s dest=%s" % (module_args, xfered, dest) + module_args = "%s src=%s dest=%s" % (module_args, pipes.quote(xfered), pipes.quote(dest)) if self.runner.check: return ReturnData(conn=conn, comm_ok=True, result=dict(changed=True), diff=dict(before_header=dest, after_header=source, before=dest_contents, after=resultant))