def RunDBA(callback):
 logging.warning('WARNING: this tool can modify low-level DynamoDB tables and attributes and should be used with caution. For example, modifying a photo or adding a label directly will not update secondary indexes nor create user updates.')
 def _OnInit(verified_schema):
  if (options.options.op == 'list'):
   def _OnList(result):
    logging.info(result)
    callback()
   db_client.DBClient.Instance().ListTables(callback=_OnList)
  else:
   if (options.options.tables == 'ALL'):
    tables = vf_schema.SCHEMA.GetTables()
   else:
    tables = [vf_schema.SCHEMA.GetTable(n) for n in options.options.tables]
   assert tables, 'no tables were specified'
   with util.Barrier(callback) as b:
    for table in tables:
     RunOpOnTable(db_client.DBClient.Instance(), table, options.options.op, b.Callback())
 db_client.InitDB(vf_schema.SCHEMA, callback=_OnInit, verify_or_create=options.options.verify_or_create)

def RunDBA ( callback ) : logging . warning ( 'WARNING: this tool can modify low-level DynamoDB tables and attributes and should be used with caution. For example, modifying a photo or adding a label directly will not update secondary indexes nor create user updates.' ) def _OnInit ( verified_schema ) : if ( options . options . op == 'list' ) : def _OnList ( result ) : logging . info ( result ) callback ( ) db_client . DBClient . Instance ( ) . ListTables ( callback = _OnList ) else : if ( options . options . tables == 'ALL' ) : tables = vf_schema . SCHEMA . GetTables ( ) else : tables = [ vf_schema . SCHEMA . GetTable ( n ) for n in options . options . tables ] assert tables , 'no tables were specified' with util . Barrier ( callback ) as b : for table in tables : RunOpOnTable ( db_client . DBClient . Instance ( ) , table , options . options . op , b . Callback ( ) ) db_client . InitDB ( vf_schema . SCHEMA , callback = _OnInit , verify_or_create = options . options . verify_or_create )
runs op on each table listed in --tables .