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
parent 676ce74cbf
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

@ -42,6 +42,8 @@ class ActionModule(ActionBase):
result = super(ActionModule, self).run(tmp, task_vars)
tmp = self._connection._shell.tempdir
try:
creates = self._task.args.get('creates')
if creates:
@ -88,7 +90,7 @@ class ActionModule(ActionBase):
if not self._play_context.check_mode:
# transfer the file to a remote tmp location
tmp_src = self._connection._shell.join_path(self._connection._shell.tempdir, os.path.basename(source))
tmp_src = self._connection._shell.join_path(tmp, os.path.basename(source))
# Convert raw_params to text for the purpose of replacing the script since
# parts and tmp_src are both unicode strings and raw_params will be different
@ -132,6 +134,6 @@ class ActionModule(ActionBase):
except AnsibleAction as e:
result.update(e.result)
finally:
self._remove_tmp_path(self._connection._shell.tempdir)
self._remove_tmp_path(tmp)
return result