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

file_upload not using local sudo #77

Open
prune998 opened this issue May 22, 2012 · 0 comments
Open

file_upload not using local sudo #77

prune998 opened this issue May 22, 2012 · 0 comments

Comments

@prune998
Copy link
Contributor

I have a general problem while running fabric (and cuisine) as an unprovileged user (fabric user).

While working on the remote host, the mode_sudo (or with mode_sudo when it work... I also have troubles) work, so my user can do anything I want.

The problem comes when you want to do a local action that require to sudo.
None of the options actualy implement this.

For example, I want to sync the /home folders of my users :

userfiles = ['.bashrc', '.bash_profile', '.vimrc', '.ssh/id_rsa.pub']
user = 'foobar'
mode_sudo()
for userfile in userfiles:
file_upload('/home/'+user+'/'+userfile, '/home/'+user+'/'+userfile)

file_upload('/home/'+user+'/'+userfile, '/home/'+user+'/'+userfile)

File "/opt/fabric/.virtualenvs/fabric/lib/python2.6/site-packages/cuisine.py", line 414, in file_upload
f = file(local, 'rb')
IOError: [Errno 13] Permission denied: '/home/foobar/.bashrc'

I'm no python expert and I can't see the right way to do a such thing...
I had a similar problem whil trying to sync the users accounts... I finaly did a shadow = local('sudo cat /etc/shadow', capture = true) which is not really ellegant...

This may be more a feature request than a bug, but still...

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

No branches or pull requests

1 participant