def finalize_backup_info(backup_info_pk, mapper_params):
 def tx():
  backup_info = BackupInformation.get(backup_info_pk)
  if backup_info:
   backup_info.complete_time = datetime.datetime.now()
   if (backup_info.filesystem == files.GS_FILESYSTEM):
    gs_bucket = mapper_params['gs_bucket_name']
    BackupInfoWriter(gs_bucket).write(backup_info)
   backup_info.put(force_writes=True)
   logging.info('Backup %s completed', backup_info.name)
  else:
   logging.warn('Backup %s could not be found', backup_info_pk)
 db.run_in_transaction(tx)

def finalize_backup_info ( backup_info_pk , mapper_params ) : def tx ( ) : backup_info = BackupInformation . get ( backup_info_pk ) if backup_info : backup_info . complete_time = datetime . datetime . now ( ) if ( backup_info . filesystem == files . GS_FILESYSTEM ) : gs_bucket = mapper_params [ 'gs_bucket_name' ] BackupInfoWriter ( gs_bucket ) . write ( backup_info ) backup_info . put ( force_writes = True ) logging . info ( 'Backup %s completed' , backup_info . name ) else : logging . warn ( 'Backup %s could not be found' , backup_info_pk ) db . run_in_transaction ( tx )
finalize the state of backupinformation and creates info file for gs .