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

Closed
wants to merge 2 commits into
from

Projects

None yet

5 participants

@nburlett
Contributor

In e7e9649, a temp_dir kwarg was added to fabric.operations.put. Since
fabric.contrib.files.upload_template makes use of fabric.operations.put,
it makes sense to add a temp_dir kwarg to upload_template and pass it
along to put.

nburlett added some commits Jul 11, 2013
@nburlett nburlett Add temp_dir to upload_template
In e7e9649, a temp_dir kwarg was added to fabric.operations.put. Since
fabric.contrib.files.upload_template makes use of fabric.operations.put,
it makes sense to add a temp_dir kwarg to upload_template and pass it
along to put.
1953b66
@nburlett nburlett Merge remote branch 'upstream/master' 5f8ef88
@Andor
Andor commented Jan 19, 2015

Please, apply this merge request!

@wbashir
wbashir commented Jan 21, 2015

+1 Please this hurts. @bitprophet is there any workarounds at the moment ?

@bitprophet bitprophet added this to the 1.11 milestone Jan 28, 2015
@elgow
elgow commented Jan 25, 2016

This patch would offer at least a partial work-around to the design problem with put() when the sudo_user is not root. I hope you will merge it soon.

The design for put() with sudo is fundamentally unsound for the general case. The problem is that the file gets transferred by sftp as the logged in user, but it's moved into its final place by the sudo_user. Unless the both the logged in user and the sudo_user have proper permissions on the temp directory and the file, the operation will fail at some point. Probably what's necessary is to perform all remote operations as root and then chown the uploaded file to the sudo_user as the last step.

@bitprophet bitprophet added a commit that referenced this pull request Apr 8, 2016
@bitprophet bitprophet Changelog re #932, closes #932 1f20939
@bitprophet bitprophet added a commit that closed this pull request Apr 8, 2016
@bitprophet bitprophet Changelog re #932, closes #932 1f20939
@bitprophet bitprophet closed this in 1f20939 Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment