tools/infra/clobber_cache_utils.py
def clobber_caches(swarming_server,
                   pool,
                   realm,
                   cache,
                   mount_rel_path,
                   dry_run,
                   bot_id=None):
  """Clobber caches on bots.

  The set of bots in `pool` in `swarming_server` with a cache named `cache` will
  be looked up and printed out then the user will be asked to confirm that the
  caches should be clobbered. If the user confirms, tasks that clobber the cache
  will be triggered on each bot or if `dry_run` is true, the command that would
  trigger such a task is printed instead.

  Args:
    * swarming_server - The swarming_server instance to lookup bots to clobber
      caches on.
    * pool - The pool of machines to lookup bots to clobber caches on.
    * realm - The realm to trigger tasks into.
    * cache - The name of the cache to clobber.
    * mount_rel_path - The relative path to mount the cache to when clobbering.
    * dry_run - Whether a dry-run should be performed where the commands that
      would be executed to trigger the clobber task are printed rather than
      actually triggering the clobber task.
    * bot_id - optional, the id of the bot that you wish to clobber.
  """
  if bot_id:
    bots = [bot_id]
  else:
    bots = _get_bots(swarming_server, pool, cache)

  print('The following bots will be clobbered:')
  print()
  for bot in bots:
    print('  %s' % bot)
  print()
  val = input('Proceed? [Y/n] ')
  if val and not val[0] in ('Y', 'y'):
    print('Cancelled.')
    return 1

  for bot in bots:
    _trigger_clobber(swarming_server, pool, realm, cache, bot, mount_rel_path,
                     dry_run)
  return 0
Clobber caches on bots.

  The set of bots in `pool` in `swarming_server` with a cache named `cache` will
  be looked up and printed out then the user will be asked to confirm that the
  caches should be clobbered. If the user confirms, tasks that clobber the cache
  will be triggered on each bot or if `dry_run` is true, the command that would
  trigger such a task is printed instead.

  Args:
    * swarming_server - The swarming_server instance to lookup bots to clobber
      caches on.
    * pool - The pool of machines to lookup bots to clobber caches on.
    * realm - The realm to trigger tasks into.
    * cache - The name of the cache to clobber.
    * mount_rel_path - The relative path to mount the cache to when clobbering.
    * dry_run - Whether a dry-run should be performed where the commands that
      would be executed to trigger the clobber task are printed rather than
      actually triggering the clobber task.
    * bot_id - optional, the id of the bot that you wish to clobber.
  
Clobber caches on bots.

The swarming_server instance to lookup bots to clobber
caches on.
pool - The pool of machines to lookup bots to clobber caches on.
realm - The realm to trigger tasks into.
cache - The name of the cache to clobber.
mount_rel_path - The relative path to mount the cache to when clobbering.
dry_run - Whether a dry-run should be performed where the commands that
would be executed to trigger the clobber task are printed rather than
actually triggering the clobber task.
bot_id - optional, the id of the bot that you wish to clobber.
Clobber caches on bots . The swarming_server instance to lookup bots to clobber caches on . pool - The pool of machines to lookup bots to clobber caches on . realm - The realm to trigger tasks into . cache - The name of the cache to clobber . mount_rel_path - The relative path to mount the cache to when clobbering . dry_run - Whether a dry - run should be performed where the commands that would be executed to trigger the clobber task are printed rather than actually triggering the clobber task . bot_id - optional the id of the bot that you wish to clobber .
def clobber_caches(swarming_server,
                   pool,
                   realm,
                   cache,
                   mount_rel_path,
                   dry_run,
                   bot_id=None):
  if bot_id:
    bots = [bot_id]
  else:
    bots = _get_bots(swarming_server, pool, cache)
  print('The following bots will be clobbered:')
  print()
  for bot in bots:
    print('  %s' % bot)
  print()
  val = input('Proceed? [Y/n] ')
  if val and not val[0] in ('Y', 'y'):
    print('Cancelled.')
    return 1
  for bot in bots:
    _trigger_clobber(swarming_server, pool, realm, cache, bot, mount_rel_path,
                     dry_run)
  return 0
def clobber_caches ( swarming_server , pool , realm , cache , mount_rel_path , dry_run , bot_id = None ) : if bot_id : bots = [ bot_id ] else : bots = _get_bots ( swarming_server , pool , cache ) print ( 'The following bots will be clobbered:' ) print ( ) for bot in bots : print ( '  %s' % bot ) print ( ) val = input ( 'Proceed? [Y/n] ' ) if val and not val [ 0 ] in ( 'Y' , 'y' ) : print ( 'Cancelled.' ) return 1 for bot in bots : _trigger_clobber ( swarming_server , pool , realm , cache , bot , mount_rel_path , dry_run ) return 0
Clobber caches on bots.
Clobber caches on bots .
"""Clobber caches on bots.

  The set of bots in `pool` in `swarming_server` with a cache named `cache` will
  be looked up and printed out then the user will be asked to confirm that the
  caches should be clobbered. If the user confirms, tasks that clobber the cache
  will be triggered on each bot or if `dry_run` is true, the command that would
  trigger such a task is printed instead.

  Args:
    * swarming_server - The swarming_server instance to lookup bots to clobber
      caches on.
    * pool - The pool of machines to lookup bots to clobber caches on.
    * realm - The realm to trigger tasks into.
    * cache - The name of the cache to clobber.
    * mount_rel_path - The relative path to mount the cache to when clobbering.
    * dry_run - Whether a dry-run should be performed where the commands that
      would be executed to trigger the clobber task are printed rather than
      actually triggering the clobber task.
    * bot_id - optional, the id of the bot that you wish to clobber.
  """
swarming_server
pool
realm
cache
mount_rel_path
dry_run
bot_id