fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] Sudo not found on Solaris


From: Ronan Amicel
Subject: Re: [Fab-user] Sudo not found on Solaris
Date: Wed, 6 Mar 2013 21:21:06 +0100


On Wed, Mar 6, 2013 at 7:58 PM, Justin Palmer <address@hidden> wrote:
Trying a simple test fabfile to run a sudo command on Solaris.  Gives the results below.  The sudo path is set via .profile which I assume would be read with shell=True.  What am I missing?  


When you use run(cmd, shell=True), fabric will execute the command within a shell.

When you use sudo(cmd, shell=True), fabric will use sudo to run this shell, but the sudo call itself will not  happen within a shell context, so your .profile is not executed, and /usr/local/bin in not in the PATH.

Try adding this at the beginning of your fabfile (after imports):

env.sudo_prefix = "/usr/local/bin/sudo -S -p '%(sudo_prompt)s' "

Hope this helps.

--
Ronan Amicel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]