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

cd() and put(use_sudo=True) do not play nice together #342

Closed
bitprophet opened this issue Aug 19, 2011 · 2 comments
Closed

cd() and put(use_sudo=True) do not play nice together #342

bitprophet opened this issue Aug 19, 2011 · 2 comments
Labels
Milestone

Comments

@bitprophet
Copy link
Member

Description

When wrapping a put(x, y, use_sudo=True) call within a with cd(): block, the hidden sudo(mv) call inside put (which moves the file from its temp location to the final destination) is honoring the cd prefix. The mv call uses a relative path in its first argument (I assume because we didn't want to specify an absolute remote temporary location?) and is thus in the wrong directory when it actually runs.

The obvious solution is to use an absolute path for the use_sudo=True temporary location. So either assume the remote system has a /tmp, or (probably better) determine the remote user's home directory as an absolute path, and then use that explicitly instead of implicitly.

Submitted by irc user dsx4ever / Egor M.


Originally submitted by Jeff Forcier (bitprophet) on 2011-04-25 at 09:06pm EDT

Relations

@ghost ghost assigned bitprophet Aug 19, 2011
@Pacek
Copy link

Pacek commented Aug 30, 2011

Having same problem ;(

@bitprophet
Copy link
Member Author

This also effects, by proxy, upload_template when used in the same situation (inside cd, and using use_sudo=True.) Confirmed report from IRC user easylancer.

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

No branches or pull requests

2 participants