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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -