def Execute(cmd, args, time_limit=(-1), bypass_whitelist=False, daemon=False, use_client_context=False, cwd=None):
 if ((not bypass_whitelist) and (not IsExecutionWhitelisted(cmd, args))):
  logging.info('Execution disallowed by whitelist: %s %s.', cmd, ' '.join(args))
  return ('', 'Execution disallowed by whitelist.', (-1), (-1))
 if daemon:
  pid = os.fork()
  if (pid == 0):
   try:
    os.setsid()
   except OSError:
    pass
   _Execute(cmd, args, time_limit, use_client_context=use_client_context, cwd=cwd)
   os._exit(0)
 else:
  return _Execute(cmd, args, time_limit, use_client_context=use_client_context, cwd=cwd)

def Execute ( cmd , args , time_limit = ( - 1 ) , bypass_whitelist = False , daemon = False , use_client_context = False , cwd = None ) : if ( ( not bypass_whitelist ) and ( not IsExecutionWhitelisted ( cmd , args ) ) ) : logging . info ( 'Execution disallowed by whitelist: %s %s.' , cmd , ' ' . join ( args ) ) return ( '' , 'Execution disallowed by whitelist.' , ( - 1 ) , ( - 1 ) ) if daemon : pid = os . fork ( ) if ( pid == 0 ) : try : os . setsid ( ) except OSError : pass _Execute ( cmd , args , time_limit , use_client_context = use_client_context , cwd = cwd ) os . _exit ( 0 ) else : return _Execute ( cmd , args , time_limit , use_client_context = use_client_context , cwd = cwd )
executes commands on the client .