Slightly nicer initialisation of Bugsnag

This commit is contained in:
Sybren A. Stüvel 2017-09-13 16:02:48 +02:00
parent f89bec5089
commit 8aa6bb61dd

View File

@ -176,7 +176,8 @@ class PillarServer(Eve):
def _config_bugsnag(self):
# Configure Bugsnag
if self.config.get('TESTING') or not self.config.get('BUGSNAG_API_KEY'):
bugsnag_api_key = self.config.get('BUGSNAG_API_KEY')
if self.config.get('TESTING') or not bugsnag_api_key:
self.log.info('Bugsnag NOT configured.')
return
@ -185,7 +186,7 @@ class PillarServer(Eve):
from bugsnag.handlers import BugsnagHandler
bugsnag.configure(
api_key=self.config['BUGSNAG_API_KEY'],
api_key=bugsnag_api_key,
project_root="/data/git/pillar/pillar",
)
handle_exceptions(self)
@ -194,6 +195,8 @@ class PillarServer(Eve):
bs_handler.setLevel(logging.ERROR)
self.log.addHandler(bs_handler)
self.log.info('Bugsnag setup complete')
def _config_google_cloud_storage(self):
# Google Cloud project
try: