def run_process(command, *args, **kwargs):
 kwargs['stdout'] = PIPE
 kwargs['stderr'] = STDOUT
 action = start_action(action_type='run_process', command=command, args=args, kwargs=kwargs)
 with action:
  process = Popen(command, *args, **kwargs)
  output = process.stdout.read()
  status = process.wait()
  result = _ProcessResult(command=command, output=output, status=status)
  Message.new(command=result.command, output=result.output, status=result.status).write()
  if result.status:
   raise _CalledProcessError(returncode=status, cmd=command, output=output)
 return result

def run_process ( command , * args , ** kwargs ) : kwargs [ 'stdout' ] = PIPE kwargs [ 'stderr' ] = STDOUT action = start_action ( action_type = 'run_process' , command = command , args = args , kwargs = kwargs ) with action : process = Popen ( command , * args , ** kwargs ) output = process . stdout . read ( ) status = process . wait ( ) result = _ProcessResult ( command = command , output = output , status = status ) Message . new ( command = result . command , output = result . output , status = result . status ) . write ( ) if result . status : raise _CalledProcessError ( returncode = status , cmd = command , output = output ) return result
run a child process .