backup_handler.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:Deploy_XXNET_Server 作者: jzp820927 项目源码 文件源码
def post(self):
    """Handler for post requests to datastore_admin/backup_abort.do.

    Abort is executed and user is redirected to the base-path handler.
    """
    backup_ids = self.request.get_all('backup_id')
    token = self.request.get('xsrf_token')
    params = ()
    if backup_ids and utils.ValidateXsrfToken(token, XSRF_ACTION):
      try:
        for backup_info in db.get(backup_ids):
          if backup_info:
            operation = backup_info.parent()
            if operation.parent_key():
              job_id = str(operation.parent_key())
              datastore_admin_service = services_client.DatastoreAdminClient()
              datastore_admin_service.abort_backup(job_id)
            else:
              utils.AbortAdminOperation(operation.key())
            delete_backup_info(backup_info)
      except Exception, e:
        logging.exception('Failed to abort pending datastore backup.')
        params = [('error', e.message)]

    self.SendRedirect(params=params)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号