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

def run_as_root ( command , * args , ** kwargs ) : if ( env . user == 'root' ) : func = run else : func = sudo return func ( command , * args , ** kwargs )
run a remote command as the root user .