python - Switching user in Fabric using with settings(user='user') -


i'm trying switch user in fabric:

def check_user():     settings(user='linevich'):         run("whoami")   

result:

[root@127.0.0.1:10022] executing task 'check_user' [root@127.0.0.1:10022] run: whoami [root@127.0.0.1:10022] login password 'linevich':  [root@127.0.0.1:10022] out: root 

what's wrong?
(no, don't want use sudo() instead.)

solution: used following command launch script:

fab -h root@127.0.0.1:10022 

right way - run without setting username:

fab -h 127.0.0.1:10022 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -