[Top][All Lists]
[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: |
Daniel Pope |
Subject: |
Re: [Fab-user] any plan for a use_sudo parameter for the run() function |
Date: |
Wed, 30 Mar 2011 13:48:12 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
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)