fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] any plan for a use_sudo parameter for the run() function


From: Morgan LEFIEUX
Subject: Re: [Fab-user] any plan for a use_sudo parameter for the run() function
Date: Wed, 30 Mar 2011 15:06:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; fr-FR; rv:1.9.2.15) Gecko/20110307 Lightning/1.0b2.105ipre1 Lanikai/3.1.9

Ah very good idea :)

thanks !

Le 30/03/2011 14:48, Daniel Pope a écrit :
On Wed, Mar 30, 2011 at 02:35:50PM +0200, Morgan LEFIEUX wrote:
It could prevent from writing multiple tests before starting a
command, for exemple:

Why not write a helper function?

def runasroot(*args, **kwargs):
     if env.user == 'root':
         return run(*args, **kwargs)
     else:
         return sudo(*args, **kwargs)

_______________________________________________
Fab-user mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/fab-user



reply via email to

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