account.py 文件源码

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

项目:rucio 作者: rucio01 项目源码 文件源码
def PUT(self, account):
        """ update the status for a given account name
        HTTP Success:
            200 OK

        HTTP Error:
            401 Unauthorized
            404 Not Found
            500 InternalError

        """
        json_data = data()
        try:
            parameter = loads(json_data)
        except ValueError:
            raise generate_http_error(400, 'ValueError', 'cannot decode json parameter dictionary')
        status = parameter.get('status', 'ACTIVE')
        try:
            set_account_status(account, status=status, issuer=ctx.env.get('issuer'))
        except ValueError:
            raise generate_http_error(400, 'ValueError', 'Unknown status %s' % status)
        except AccessDenied, e:
            raise generate_http_error(401, 'AccessDenied', e.args[0][0])
        except AccountNotFound, e:
            raise generate_http_error(404, 'AccountNotFound', e.args[0][0])
        except Exception, e:
            raise InternalError(e)

        raise OK()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号