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

@ -36,6 +36,8 @@ class ActionModule(ActionBase):
result = super(ActionModule, self).run(tmp, task_vars)
tmp = self._connection._shell.tempdir
src = self._task.args.get('src', None)
remote_src = boolean(self._task.args.get('remote_src', 'no'), strict=False)
@ -52,7 +54,7 @@ class ActionModule(ActionBase):
except AnsibleError as e:
raise AnsibleActionFail(to_native(e))
tmp_src = self._connection._shell.join_path(self._connection._shell.tempdir, os.path.basename(src))
tmp_src = self._connection._shell.join_path(tmp, os.path.basename(src))
self._transfer_file(src, tmp_src)
self._fixup_perms2((tmp_src,))
@ -67,5 +69,5 @@ 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