app.py 文件源码

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

项目:gremlin 作者: amalgam8 项目源码 文件源码
def delete_recipe(recipe_id):
    # clear fault injection rules
    url = '{0}/v1/rules?tag={1}'.format(a8_controller_url, recipe_id)
    headers = {}
    if a8_controller_token != "" :
        headers['Authorization'] = "Bearer " + token

    try:
        r = requests.delete(url, headers=headers)
    except Exception, e:
        sys.stderr.write("Could not DELETE {0}".format(url))
        sys.stderr.write("\n")
        sys.stderr.write(str(e))
        sys.stderr.write("\n")
        abort(500, "Could not DELETE {0}".format(url))

    if r.status_code != 200 and r.status_code != 204:
        abort(r.status_code)

    return ""
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号