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

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -