Do not configure bugsnag without API key.

This commit is contained in:
Sybren A. Stüvel 2016-05-17 13:40:49 +02:00
parent 1da077422c
commit b556caf8dd

View File

@ -123,7 +123,7 @@ if app.config['DEBUG']:
log.info('Pillar starting, debug=%s', app.config['DEBUG']) log.info('Pillar starting, debug=%s', app.config['DEBUG'])
# Configure Bugsnag # Configure Bugsnag
if not app.config.get('TESTING'): if not app.config.get('TESTING') and app.config.get('BUGSNAG_API_KEY'):
bugsnag.configure( bugsnag.configure(
api_key=app.config['BUGSNAG_API_KEY'], api_key=app.config['BUGSNAG_API_KEY'],
project_root="/data/git/pillar/pillar", project_root="/data/git/pillar/pillar",
@ -133,6 +133,8 @@ if not app.config.get('TESTING'):
bs_handler = bugsnag.handlers.BugsnagHandler() bs_handler = bugsnag.handlers.BugsnagHandler()
bs_handler.setLevel(logging.ERROR) bs_handler.setLevel(logging.ERROR)
log.addHandler(bs_handler) log.addHandler(bs_handler)
else:
log.info('Bugsnag NOT configured.')
# Google Cloud project # Google Cloud project
try: try: