Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib.files.upload_template should pass along temp_dir to put #932

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions fabric/contrib/files.py
Expand Up @@ -65,7 +65,7 @@ def first(*args, **kwargs):

def upload_template(filename, destination, context=None, use_jinja=False,
template_dir=None, use_sudo=False, backup=True, mirror_local_mode=False,
mode=None):
mode=None, temp_dir=''):
"""
Render and upload a template text file to a remote host.

Expand All @@ -89,12 +89,14 @@ def upload_template(filename, destination, context=None, use_jinja=False,
By default, the file will be copied to ``destination`` as the logged-in
user; specify ``use_sudo=True`` to use `sudo` instead.

The ``mirror_local_mode`` and ``mode`` kwargs are passed directly to an
internal `~fabric.operations.put` call; please see its documentation for
details on these two options.
The ``mirror_local_mode``, ``mode``, and ``temp_dir`` kwargs are passed
directly to an internal `~fabric.operations.put` call; please see its
documentation for details on these two options.

.. versionchanged:: 1.1
Added the ``backup``, ``mirror_local_mode`` and ``mode`` kwargs.
.. versionchanged:: 1.7
Added the ``temp_dir`` kwarg
"""
func = use_sudo and sudo or run
# Normalize destination to be an actual filename, due to using StringIO
Expand Down Expand Up @@ -145,7 +147,8 @@ def upload_template(filename, destination, context=None, use_jinja=False,
remote_path=destination,
use_sudo=use_sudo,
mirror_local_mode=mirror_local_mode,
mode=mode
mode=mode,
temp_dir=temp_dir
)


Expand Down