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
Fab-user@nongnu.org
http://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to