@gen.engine
def _Run(callback):
 job_set = options.options.job_set
 assert (job_set in kJobSets.keys()), ('--job_set must be one of %r' % kJobSets.keys())
 jobs = kJobSets[job_set]
 client = db_client.DBClient.Instance()
 job = Job(client, job_set)
 got_lock = (yield gen.Task(job.AcquireLock))
 if (not got_lock):
  logging.warning('Failed to acquire job lock: exiting.')
  callback()
  return
 try:
  for (title, args) in jobs:
   logging.info(('[%s] running %s' % (title, ' '.join(args))))
   proc = process.Subprocess(args, io_loop=ioloop.IOLoop.instance())
   code = (yield gen.Task(proc.set_exit_callback))
   logging.info(('[%s] finished with code: %r' % (title, code)))
 except:
  logging.error(traceback.format_exc())
 finally:
  (yield gen.Task(job.ReleaseLock))
 callback()

@ gen . engine def _Run ( callback ) : job_set = options . options . job_set assert ( job_set in kJobSets . keys ( ) ) , ( '--job_set must be one of %r' % kJobSets . keys ( ) ) jobs = kJobSets [ job_set ] client = db_client . DBClient . Instance ( ) job = Job ( client , job_set ) got_lock = ( yield gen . Task ( job . AcquireLock ) ) if ( not got_lock ) : logging . warning ( 'Failed to acquire job lock: exiting.' ) callback ( ) return try : for ( title , args ) in jobs : logging . info ( ( '[%s] running %s' % ( title , ' ' . join ( args ) ) ) ) proc = process . Subprocess ( args , io_loop = ioloop . IOLoop . instance ( ) ) code = ( yield gen . Task ( proc . set_exit_callback ) ) logging . info ( ( '[%s] finished with code: %r' % ( title , code ) ) ) except : logging . error ( traceback . format_exc ( ) ) finally : ( yield gen . Task ( job . ReleaseLock ) ) callback ( )
grab the lock and run all commands an subprocesess .