Hello,

Has anybody met this problem before?

I have a simple test fabfile.py:

from fabric.api import *

def test():
    sudo('dpkg -i testpackage.deb')

$ fab test
works as expected when I log into remote host with my local username.

When I add a different user to ~/.fabricrc:
user = testuser

$ fab test
fails with
--------------------------------------------------------------------
...
[testdev] sudo: dpkg -i testpackage.deb
[testdev] err: bash: sudo: command not found

Fatal error: sudo() encountered an error (return code 127) while executing
'dpkg -i testpackage.deb'

Aborting.
---------------------------------------------------------------------

If I log manually into 'testdev' under 'testuser' account I can run 'sudo'
command without any problem.

I checked paths to make sure that 'sudo' on the remote host is available
when Fabric is running 'test' command, tried sudo() with different
combinations of 'shell' and 'pty' parameters - no luck.

I also checked manually that the user 'testuser' can run sudo on the
remote host under a new shell:
$ /bin/bash -l -c "sudo dpkg -i testpackage.deb"

Any idea about what could go wrong?

P.S: Tested with stable Fabric 0.9.0 and with a current source from GitHub

Thanks,
Ruslan
_______________________________________________
Fab-user mailing list
Fab-user@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to