template: change to pass along the correct template path (#35027)

* template: change to pass along the correct template path

* standardise tmp path behaviour

* removed if condition as it should not be needed
This commit is contained in:
Jordan Borean 2018-01-19 09:51:42 +10:00 committed by GitHub
commit 389f4ef1fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 41 additions and 25 deletions

View file

@ -258,7 +258,7 @@ class ActionModule(ActionBase):
return result
# Define a remote directory that we will copy the file to.
tmp_src = self._connection._shell.join_path(self._connection._shell.tempdir, 'source')
tmp_src = self._connection._shell.join_path(tmp, 'source')
remote_path = None
@ -273,7 +273,7 @@ class ActionModule(ActionBase):
# fix file permissions when the copy is done as a different user
if remote_path:
self._fixup_perms2((self._connection._shell.tempdir, remote_path))
self._fixup_perms2((tmp, remote_path))
if raw:
# Continue to next iteration if raw is defined.
@ -389,8 +389,7 @@ class ActionModule(ActionBase):
result = super(ActionModule, self).run(tmp, task_vars)
if tmp is None:
tmp = self._connection._shell.tempdir
tmp = self._connection._shell.tempdir
source = self._task.args.get('src', None)
content = self._task.args.get('content', None)
@ -548,6 +547,6 @@ class ActionModule(ActionBase):
result.update(dict(dest=dest, src=source, changed=changed))
# Delete tmp path
self._remove_tmp_path(self._connection._shell.tempdir)
self._remove_tmp_path(tmp)
return result