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

Added use_sudo and temp_dir params to operations.get(). Fixes #700 #1121

merged 1 commit into from Sep 4, 2014


Copy link

@xarg xarg commented Apr 20, 2014

Also added some tests for the use_sudo + temp_dir combination for operations.put()

Copy link

Linking to #700 since the mention in the subject didn't do so :) (and - thanks! Labeling for followup.)

@bitprophet bitprophet added Feature and removed Contrib labels Aug 4, 2014
@bitprophet bitprophet added this to the 1.10 milestone Aug 6, 2014
Copy link

Merging and testing this now and there's a problem, at least on my localhost system (OS X / BSD userland) the chmod this code adds causes the file to be unreadable, resulting in an IOError from Paramiko's SFTP module, and a created-but-empty local file at the expected path.

The reason it fails is because the chmod is 0404 intending it to be root and owner readable...but the file is already owned by root at this point in time (and then when it's copied by SFTP)! I.e. sudo cp creates a new file owned by root, not by the original owner.

Both BSD and Linux versions of cp seem to support the -p flag which preserves user/group/timestamps - this feels more like what we want anyways. I am adding this for now.

@bitprophet bitprophet merged commit 305f2a6 into fabric:master Sep 4, 2014
Copy link

j-san commented Jun 8, 2015

Does not work yet for directories :)

example: get('/data/media/', use_sudo=True)

The problem comes from sftp.glob
The glob function does not suppert use_sudo param. Called from fabric.operations.get

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants