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
Bug
Milestone

Comments

@bitprophet
Copy link
Member

@bitprophet bitprophet commented Aug 19, 2011

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

  • Duplicated by #398: operations.put with use_sudo=True does not work inside "cd" context manager
@ghost ghost assigned bitprophet Aug 19, 2011
@Pacek
Copy link

@Pacek Pacek commented Aug 30, 2011

Having same problem ;(

@bitprophet
Copy link
Member Author

@bitprophet bitprophet commented Sep 26, 2011

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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.