From 322530761e6fd9b8ae44a99c6b2a361122ec9f0c Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Tue, 20 Oct 2015 23:52:18 +0200 Subject: [PATCH] Added bugsnag --- pillar/application/__init__.py | 13 ++++++++----- requirements.txt | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pillar/application/__init__.py b/pillar/application/__init__.py index f36087ae..89ad3dba 100644 --- a/pillar/application/__init__.py +++ b/pillar/application/__init__.py @@ -1,13 +1,10 @@ import os import json import requests - +import bugsnag +from bugsnag.flask import handle_exceptions from eve import Eve from pymongo import MongoClient - -# import random -# import string - from eve.auth import TokenAuth from eve.auth import BasicAuth from eve.io.mongo import Validator @@ -207,6 +204,7 @@ class ValidateCustomFields(Validator): def post_item(entry, data): return post_internal(entry, data) + # We specify a settings.py file because when running on wsgi we can't detect it # automatically. The default path (which work in Docker) can be overriden with # an env variable. @@ -218,6 +216,11 @@ app.config.from_object(config.Deployment) client = MongoClient(app.config['MONGO_HOST'], 27017) db = client.eve +bugsnag.configure( + api_key = app.config['BUGSNAG_API_KEY'], + project_root = "/date/dev/pillar/pillar", +) +handle_exceptions(app) def check_permissions(resource, method, append_allowed_methods=False): diff --git a/requirements.txt b/requirements.txt index f258a4fe..90d292af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +blinker==1.4 bugsnag==2.3.1 Cerberus==0.8 cffi==1.2.1